From a26cc38ba40fecf20582b114abcb4a6f00be32d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20V=C3=A1clav=C3=ADk?= Date: Thu, 16 Jan 2025 08:21:14 +0100 Subject: [PATCH] feat(suite): Add parameters for window size (electron) from terminal (#16324) --- packages/suite-desktop-core/src/app.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/suite-desktop-core/src/app.ts b/packages/suite-desktop-core/src/app.ts index f9f2f6ac2bd..76446c3f3b5 100644 --- a/packages/suite-desktop-core/src/app.ts +++ b/packages/suite-desktop-core/src/app.ts @@ -186,7 +186,12 @@ const init = async () => { const computerInfo = await getComputerInfo(); logger.debug('computer', computerInfo); - const winBounds = store.getWinBounds(); + const widthArg = parseInt(app.commandLine.getSwitchValue('width'), 10); + const heightArg = parseInt(app.commandLine.getSwitchValue('height'), 10); + const winBounds = { + width: !isNaN(widthArg) ? Math.max(widthArg, MIN_WIDTH) : store.getWinBounds().width, + height: !isNaN(heightArg) ? Math.max(heightArg, MIN_HEIGHT) : store.getWinBounds().height, + }; logger.debug('init', `Create Browser Window (${winBounds.width}x${winBounds.height})`); // init modules