fix(electrobun): re-enable CSS resize handles + GTK button-press only

Motion handler crashes in Bun's JSCallback FFI bridge — disabled.
CSS handles provide cursor feedback. GTK button-press-event handles
actual resize via begin_resize_drag with real event timestamp.

Bundler issue resolved: syntax error in /* */ comment was preventing
Electrobun's bundler from compiling gtk-resize.ts.
This commit is contained in:
Hibryda 2026-03-25 16:12:15 +01:00
parent 828e97276a
commit e563da2b3b
2 changed files with 8 additions and 6 deletions

View file

@ -76,8 +76,8 @@ export function installNativeResize(windowPtr: number | bigint) {
// Add event masks
lib.symbols.gtk_widget_add_events(windowPtr as any, (1<<2) | (1<<8) | (1<<5));
// Motion handler disabled — isolating button-press resize first
// TODO: re-enable cursor change on hover once resize works
// Motion handler skipped — cursor feedback provided by CSS resize handles instead.
// The FFI motion callback causes crashes in Bun's JSCallback bridge.
// Button press — initiate resize if in border zone
buttonCb = new JSCallback(
@ -111,9 +111,7 @@ export function installNativeResize(windowPtr: number | bigint) {
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);
// Motion handler disabled for now — isolating button-press resize
// const sigMN = Buffer.from("motion-notify-event\0");
// lib.symbols.g_signal_connect_data(windowPtr as any, ptr(sigMN) as any, motionCb.ptr as any, null, null, 0);
// Motion signal NOT connected — cursor feedback via CSS handles instead
console.log("[gtk-resize] Native resize handlers installed (border=" + BORDER + "px)");
}

View file

@ -322,7 +322,11 @@
onClose={() => setNotifDrawerOpen(false)}
/>
<!-- Resize handled natively by GTK (gtk-resize.ts) — 8px border zone on the GtkWindow -->
<!-- Resize cursor handles — visual feedback only. Actual resize is handled by GTK (gtk-resize.ts) -->
<div class="rz rz-n"></div><div class="rz rz-s"></div>
<div class="rz rz-e"></div><div class="rz rz-w"></div>
<div class="rz rz-ne"></div><div class="rz rz-nw"></div>
<div class="rz rz-se"></div><div class="rz rz-sw"></div>
<div class="app-shell" role="presentation">
<!-- Left sidebar icon rail — draggable for window move -->