detached a4698c6

refactor(browser): prevent GTK bloom filter corruption

Don't manually remove GTK controllers before reparenting - GTK4 does this
automatically. Manually removing causes GTK bloom filter corruption and
assertion failures. Just mark for reattachment and clear references.
commit
a4698c61036dc90f3357f476ca5c1d93aabd6cdf
author
bamen · · 2025-10-09 18:46 UTC
committer
bamen · · 2025-10-09 18:03 UTC
parent
3a7535c
signature
unsigned
1 file · +11 -6
M internal/app/browser/workspace_pane_ops.go +11 -6
@@ -128,8 +128,10 @@ func (wm *WorkspaceManager) clonePaneState(_ *paneNode, target *paneNode) {
128128 // Omnibox will auto-open on about:blank via client-side detection
129129 }
130130
131-// safelyDetachControllersBeforeReparent removes GTK controllers that GTK will auto-clean up during reparenting.
132-// It marks nodes for reattachment once the widget hierarchy settles after the split operation.
131+// safelyDetachControllersBeforeReparent marks nodes for controller reattachment after reparenting.
132+// GTK4 automatically removes controllers when widgets are unparented, so we just clear our
133+// references and mark for reattachment. Manually removing controllers causes GTK bloom filter
134+// corruption (double-removal assertion failure).
133135 func (wm *WorkspaceManager) safelyDetachControllersBeforeReparent(node *paneNode) {
134136 if wm == nil || node == nil {
135137 return
@@ -140,15 +142,18 @@ func (wm *WorkspaceManager) safelyDetachControllersBeforeReparent(node *paneNode
140142 return
141143 }
142144
145+ // Just mark for reattachment and clear our references
146+ // GTK4 will auto-remove controllers during unparent
143147 if target.hoverToken != nil {
144148 target.pendingHoverReattach = true
145- wm.detachHover(target)
149+ target.hoverToken = nil // Clear reference, don't manually remove
150+ log.Printf("[workspace] Marked hover controller for reattach on pane %p (GTK will auto-remove)", target)
146151 }
147152
148- if wm.focusStateMachine != nil && target.focusControllerToken != 0 {
149- token := target.focusControllerToken
153+ if target.focusControllerToken != 0 {
150154 target.pendingFocusReattach = true
151- wm.focusStateMachine.detachGTKController(target, token)
155+ target.focusControllerToken = 0 // Clear reference, don't manually remove
156+ log.Printf("[workspace] Marked focus controller for reattach on pane %p (GTK will auto-remove)", target)
152157 }
153158 }
154159
@@ -128,8 +128,10 @@ func (wm *WorkspaceManager) clonePaneState(_ *paneNode, target *paneNode) {
128 // Omnibox will auto-open on about:blank via client-side detection128 // Omnibox will auto-open on about:blank via client-side detection
129 }129 }
130 130
131-// safelyDetachControllersBeforeReparent removes GTK controllers that GTK will auto-clean up during reparenting.131+// safelyDetachControllersBeforeReparent marks nodes for controller reattachment after reparenting.
132-// It marks nodes for reattachment once the widget hierarchy settles after the split operation.132+// GTK4 automatically removes controllers when widgets are unparented, so we just clear our
133+// references and mark for reattachment. Manually removing controllers causes GTK bloom filter
134+// corruption (double-removal assertion failure).
133 func (wm *WorkspaceManager) safelyDetachControllersBeforeReparent(node *paneNode) {135 func (wm *WorkspaceManager) safelyDetachControllersBeforeReparent(node *paneNode) {
134 if wm == nil || node == nil {136 if wm == nil || node == nil {
135 return137 return
@@ -140,15 +142,18 @@ func (wm *WorkspaceManager) safelyDetachControllersBeforeReparent(node *paneNode
140 return142 return
141 }143 }
142 144
145+ // Just mark for reattachment and clear our references
146+ // GTK4 will auto-remove controllers during unparent
143 if target.hoverToken != nil {147 if target.hoverToken != nil {
144 target.pendingHoverReattach = true148 target.pendingHoverReattach = true
145- wm.detachHover(target)149+ target.hoverToken = nil // Clear reference, don't manually remove
150+ log.Printf("[workspace] Marked hover controller for reattach on pane %p (GTK will auto-remove)", target)
146 }151 }
147 152
148- if wm.focusStateMachine != nil && target.focusControllerToken != 0 {153+ if target.focusControllerToken != 0 {
149- token := target.focusControllerToken
150 target.pendingFocusReattach = true154 target.pendingFocusReattach = true
151- wm.focusStateMachine.detachGTKController(target, token)155+ target.focusControllerToken = 0 // Clear reference, don't manually remove
156+ log.Printf("[workspace] Marked focus controller for reattach on pane %p (GTK will auto-remove)", target)
152 }157 }
153 }158 }
154 159

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