feat(electrobun): native C resize lib + stub test page + deferred init

- agor_resize.c: C library with GTK signal handlers for resize
- native-resize.ts: Bun FFI wrapper for libagor-resize.so
- resize-test.html: minimal stub for isolating resize behavior
- index.ts: native resize disabled pending stability testing
- RESIZE_TEST env var for loading stub page via Vite
This commit is contained in:
Hibryda 2026-03-25 17:01:11 +01:00
parent 178e560068
commit 449fa3dcae
3 changed files with 174 additions and 6 deletions

View file

@ -202,6 +202,13 @@ relayClient.onStatus((machineId, status, error) => {
// ── App window ────────────────────────────────────────────────────────────
async function getMainViewUrl(): Promise<string> {
// TEMPORARY: load resize test stub via Vite dev server (keeps RPC bridge)
const RESIZE_TEST = false; // DISABLED — use normal app for now
if (RESIZE_TEST) {
const testUrl = DEV_SERVER_URL + "/resize-test.html";
console.log(`[RESIZE_TEST] Loading stub via Vite: ${testUrl}`);
return testUrl;
}
const channel = await Updater.localInfo.channel();
if (channel === "dev") {
try {
@ -237,12 +244,9 @@ mainWindow = new BrowserWindow({
},
});
// Native resize via C shared library (libagor-resize.so)
// Owns GTK signal connections in C — no JSCallback boundary crossing
try {
const { initNativeResize } = require("./native-resize.ts");
initNativeResize((mainWindow as any).ptr, 8);
} catch (e) { console.error("[native-resize] init failed:", e); }
// Native resize COMPLETELY DISABLED for stability testing
// TODO: re-enable after verifying the app starts without it
console.log("[native-resize] DISABLED — testing app startup stability");
// 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,