From d632fdb253c75cd9b5cfb8405b23be9eeed84587 Mon Sep 17 00:00:00 2001 From: aaddrick Date: Thu, 14 May 2026 07:24:23 -0400 Subject: [PATCH] fix: catch About window after upstream titleBarStyle change, guard Hardware Buddy (#481) Upstream migrated the About window from titleBarStyle:"" to titleBarStyle:"hiddenInset" (build-reference/.../index.js:524746). isPopupWindow() stopped matching it, so About got frame:true and the main-window resize handlers, breaking its render on GNOME/X11. Picks up @Hayao0819's #489 with two adjustments on top of his fix: - Refresh the stale window-kind comment block. All three of the documented titleBarStyle values were wrong post-migration; the block now reflects current upstream and the Hardware Buddy child modal at index.js:536666 that didn't exist when the original comment was written. - Add a 'parent' in options early-return. Hardware Buddy declares `parent: Et ?? void 0` and shares the About window's titleBarStyle / no-minWidth shape -- without the parent check, the extended match would strip its frame and attach main-window handlers to it. Same failure mode as #481, just on a different window. Hayao0819's diagnosis and one-line logic extension are preserved. Fixes #481 Co-Authored-By: hayao Co-Authored-By: Claude --- scripts/frame-fix-wrapper.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/frame-fix-wrapper.js b/scripts/frame-fix-wrapper.js index 7d87d25..71920b7 100644 --- a/scripts/frame-fix-wrapper.js +++ b/scripts/frame-fix-wrapper.js @@ -81,15 +81,19 @@ const CLOSE_TO_TRAY = process.platform === 'linux' && process.env.CLAUDE_QUIT_ON_CLOSE !== '1'; console.log(`[Frame Fix] Close-to-tray: ${CLOSE_TO_TRAY ? 'on' : 'off'}`); -// Detect if a window intends to be frameless (popup/Quick Entry/About) -// Quick Entry: titleBarStyle:"", skipTaskbar:true, transparent:true, resizable:false -// About: titleBarStyle:"", skipTaskbar:true, resizable:false -// Main: titleBarStyle:"", titleBarOverlay:false(linux), resizable (has minWidth) -// The main window has minWidth set; popups do not. +// Detect if a window intends to be frameless (popup/Quick Entry/About). +// Window kinds — see build-reference/app-extracted/.vite/build/index.js: +// Quick Entry: titleBarStyle:"hidden", frame:false (caught early) +// About: titleBarStyle:"hiddenInset", no minWidth, no parent +// Main: titleBarStyle:"hidden", minWidth:600 +// Hardware Buddy: titleBarStyle:"hiddenInset", parent set (child modal — keep frame) +// minWidth excludes Main; the `parent` key excludes Hardware Buddy. About +// went from "" to "hiddenInset" upstream, so the test matches either. function isPopupWindow(options) { if (!options) return false; if (options.frame === false) return true; - if (options.titleBarStyle === '' && !options.minWidth) return true; + if ('parent' in options) return false; + if ((options.titleBarStyle === '' || options.titleBarStyle === 'hiddenInset') && !options.minWidth) return true; return false; }