Revert "fix(electrobun): connect button-press on WebView child too (events go to deepest child)"
This reverts commit 74ec191ce9.
This commit is contained in:
parent
74ec191ce9
commit
b9169ec046
1 changed files with 1 additions and 16 deletions
|
|
@ -109,24 +109,9 @@ export function installNativeResize(windowPtr: number | bigint) {
|
||||||
{ args: [FFIType.ptr, FFIType.ptr, FFIType.ptr], returns: FFIType.i32 },
|
{ 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");
|
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);
|
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)
|
// Motion signal NOT connected — cursor feedback via CSS handles instead
|
||||||
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");
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("[gtk-resize] Native resize handlers installed (border=" + BORDER + "px)");
|
console.log("[gtk-resize] Native resize handlers installed (border=" + BORDER + "px)");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue