From 9fd2bbd291497ac85915549d22b1b1a0d4f35775 Mon Sep 17 00:00:00 2001 From: xingzihai <1315258019@qq.com> Date: Wed, 1 Apr 2026 19:56:41 +0000 Subject: [PATCH] feat: allow window to be resizable - Set WindowConfig.resizable to true - Remove resizable = false in DevTools closed event - Update test to expect resizable = true Fixes #2441 --- src/main/config.test.ts | 2 +- src/main/config.ts | 2 +- src/main/lifecycle/window.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/config.test.ts b/src/main/config.test.ts index f0c4412cd..6311ed098 100644 --- a/src/main/config.test.ts +++ b/src/main/config.test.ts @@ -30,7 +30,7 @@ describe('main/config.ts', () => { expect(WindowConfig.height).toBe(400); expect(WindowConfig.minWidth).toBe(500); expect(WindowConfig.minHeight).toBe(400); - expect(WindowConfig.resizable).toBe(false); + expect(WindowConfig.resizable).toBe(true); expect(WindowConfig.skipTaskbar).toBe(true); expect(WindowConfig.webPreferences).toBeDefined(); expect(WindowConfig.webPreferences.contextIsolation).toBe(true); diff --git a/src/main/config.ts b/src/main/config.ts index 84501bc49..18f818c4f 100644 --- a/src/main/config.ts +++ b/src/main/config.ts @@ -44,7 +44,7 @@ export const WindowConfig: BrowserWindowConstructorOptions = { height: 400, minWidth: 500, minHeight: 400, - resizable: false, + resizable: true, /** Hide the app from the Windows taskbar */ skipTaskbar: true, webPreferences: { diff --git a/src/main/lifecycle/window.ts b/src/main/lifecycle/window.ts index a3392b5e5..6353ce9cc 100644 --- a/src/main/lifecycle/window.ts +++ b/src/main/lifecycle/window.ts @@ -34,11 +34,11 @@ export function configureWindowEvents(mb: Menubar): void { /** * When DevTools is closed, restore the window to its original size and position it centered on the tray icon. + * Keep the window resizable to allow users to adjust the size at any time. */ mb.window.webContents.on('devtools-closed', () => { const trayBounds = mb.tray.getBounds(); mb.window.setSize(WindowConfig.width, WindowConfig.height); mb.positioner.move('trayCenter', trayBounds); - mb.window.resizable = false; }); }