detached 2738642

fix(ui): avoid leaking paned notify callbacks

Use ConnectNotifyWithDetail for notify::position wiring and align resize defaults ordering in docs.
commit
2738642c959da5f48aba5d96e309da93ae0ff698
author
brice · · 2025-12-26 08:20 UTC
parent
1dfccc3
signature
unsigned
2 files · +7 -8
M docs/CONFIG.md +4 -4
@@ -256,10 +256,10 @@ cancel = ["escape"]
256256 **Default resize mode actions:**
257257 ```toml
258258 [workspace.resize_mode.actions]
259-resize-increase-left = ["arrowleft", "h"]
260-resize-increase-down = ["arrowdown", "j"]
261-resize-increase-up = ["arrowup", "k"]
262-resize-increase-right = ["arrowright", "l"]
259+resize-increase-left = ["h", "arrowleft"]
260+resize-increase-down = ["j", "arrowdown"]
261+resize-increase-up = ["k", "arrowup"]
262+resize-increase-right = ["l", "arrowright"]
263263 resize-decrease-left = ["H"]
264264 resize-decrease-down = ["J"]
265265 resize-decrease-up = ["K"]
@@ -256,10 +256,10 @@ cancel = ["escape"]
256 **Default resize mode actions:**256 **Default resize mode actions:**
257 ```toml257 ```toml
258 [workspace.resize_mode.actions]258 [workspace.resize_mode.actions]
259-resize-increase-left = ["arrowleft", "h"]259+resize-increase-left = ["h", "arrowleft"]
260-resize-increase-down = ["arrowdown", "j"]260+resize-increase-down = ["j", "arrowdown"]
261-resize-increase-up = ["arrowup", "k"]261+resize-increase-up = ["k", "arrowup"]
262-resize-increase-right = ["arrowright", "l"]262+resize-increase-right = ["l", "arrowright"]
263 resize-decrease-left = ["H"]263 resize-decrease-left = ["H"]
264 resize-decrease-down = ["J"]264 resize-decrease-down = ["J"]
265 resize-decrease-up = ["K"]265 resize-decrease-up = ["K"]
M internal/ui/layout/gtk_widgets.go +3 -4
@@ -1,7 +1,6 @@
11 package layout
22
33 import (
4- "github.com/jwijenbergh/purego"
54 "github.com/jwijenbergh/puregotk/v4/gdk"
65 "github.com/jwijenbergh/puregotk/v4/gobject"
76 "github.com/jwijenbergh/puregotk/v4/graphene"
@@ -165,10 +164,10 @@ func (p *gtkPaned) ConnectMap(callback func()) uint32 {
165164 }
166165
167166 func (p *gtkPaned) ConnectNotifyPosition(callback func()) uint32 {
168- cbPtr := purego.NewCallback(func() {
167+ cb := func(_ gobject.Object, _ uintptr) {
169168 callback()
170- })
171- return gobject.SignalConnect(p.inner.GoPointer(), "notify::position", cbPtr)
169+ }
170+ return p.inner.ConnectNotifyWithDetail("position", &cb)
172171 }
173172
174173 func (p *gtkPaned) AddTickCallback(callback func() bool) uint {
@@ -1,7 +1,6 @@
1 package layout1 package layout
2 2
3 import (3 import (
4- "github.com/jwijenbergh/purego"
5 "github.com/jwijenbergh/puregotk/v4/gdk"4 "github.com/jwijenbergh/puregotk/v4/gdk"
6 "github.com/jwijenbergh/puregotk/v4/gobject"5 "github.com/jwijenbergh/puregotk/v4/gobject"
7 "github.com/jwijenbergh/puregotk/v4/graphene"6 "github.com/jwijenbergh/puregotk/v4/graphene"
@@ -165,10 +164,10 @@ func (p *gtkPaned) ConnectMap(callback func()) uint32 {
165 }164 }
166 165
167 func (p *gtkPaned) ConnectNotifyPosition(callback func()) uint32 {166 func (p *gtkPaned) ConnectNotifyPosition(callback func()) uint32 {
168- cbPtr := purego.NewCallback(func() {167+ cb := func(_ gobject.Object, _ uintptr) {
169 callback()168 callback()
170- })169+ }
171- return gobject.SignalConnect(p.inner.GoPointer(), "notify::position", cbPtr)170+ return p.inner.ConnectNotifyWithDetail("position", &cb)
172 }171 }
173 172
174 func (p *gtkPaned) AddTickCallback(callback func() bool) uint {173 func (p *gtkPaned) AddTickCallback(callback func() bool) uint {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close