Revert "fix(electrobun): connect button-press on WebView child too (events go to deepest child)"

This reverts commit 74ec191ce9.
This commit is contained in:
Hibryda 2026-03-25 16:15:55 +01:00
parent 74ec191ce9
commit b9169ec046

View file

@ -109,24 +109,9 @@ export function installNativeResize(windowPtr: number | bigint) {
{ args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
);
// Connect on BOTH the GtkWindow AND its child (WebView).
// GTK delivers events to the topmost child GdkWindow — the WebView covers 100%.
// The GtkWindow signal alone won't fire because events go to the WebView child.
const sigBP = Buffer.from("button-press-event\0");
lib.symbols.g_signal_connect_data(windowPtr as any, ptr(sigBP) as any, buttonCb.ptr as any, null, null, 0);
// Also connect on the deepest child (the WebView)
let child = windowPtr as any;
for (let i = 0; i < 5; i++) {
try {
const c = lib.symbols.gtk_bin_get_child(child);
if (!c) break;
child = c;
} catch { break; }
}
if (child !== windowPtr) {
lib.symbols.g_signal_connect_data(child, ptr(sigBP) as any, buttonCb.ptr as any, null, null, 0);
console.log("[gtk-resize] Also connected button-press on child widget");
}
// Motion signal NOT connected — cursor feedback via CSS handles instead
console.log("[gtk-resize] Native resize handlers installed (border=" + BORDER + "px)");
}