fix(electrobun): disable all GTK FFI, JS-only resize via setFrame RPC

Bun segfaults (address 0x10) from prior GTK widget tree modifications
(wrapWebViewInScrolledWindow corrupted the tree). Disabled all GTK FFI
except begin_move_drag (which works). JS handles capture mouse events,
compute delta, and call window.setFrame RPC.

Clean build required: rm -rf ui-electrobun/build/

Status: resize outward works, resize inward blocked by WebView min-size.
Next: need C shared library for proper GTK signal connection.
This commit is contained in:
Hibryda 2026-03-25 16:26:00 +01:00
parent b9169ec046
commit de40bcbcac
2 changed files with 78 additions and 20 deletions

View file

@ -240,15 +240,11 @@ mainWindow = new BrowserWindow({
},
});
// Install native GTK resize handlers (tao/Tauri pattern)
// This connects button-press-event directly on the GtkWindow,
// handling resize BEFORE WebKitGTK processes events.
{
const { ensureResizable } = require("./gtk-window.ts");
ensureResizable((mainWindow as any).ptr);
const { installNativeResize } = require("./gtk-resize.ts");
installNativeResize((mainWindow as any).ptr);
}
// GTK window setup — only log resizable status, skip all FFI modifications
// (forceSmallMinSize and wrapWebViewInScrolledWindow caused crashes)
try {
console.log("[gtk] Window ptr:", (mainWindow as any).ptr);
} catch (e) { console.error("[gtk] ptr access failed:", e); }
// Prevent GTK's false Ctrl+click detection from closing the window on initial load.
// WebKitGTK reports stale modifier state (0x14 = Ctrl+Alt) after SIGTERM of previous instance,