diff --git a/src/main/Core/BrowserWindow/BrowserWindowModule.ts b/src/main/Core/BrowserWindow/BrowserWindowModule.ts index f1703d1ef..8fe6bba34 100644 --- a/src/main/Core/BrowserWindow/BrowserWindowModule.ts +++ b/src/main/Core/BrowserWindow/BrowserWindowModule.ts @@ -166,7 +166,13 @@ export class BrowserWindowModule { ipcMain.on("escapePressed", () => shouldHideWindowOnEscapePressed() && browserWindowToggler.hide()); - app.on("second-instance", () => browserWindowToggler.showAndFocus()); + app.on("second-instance", (_, argv) => { + if (argv.includes("--toggle")) { + browserWindowToggler.toggle(); + } else { + browserWindowToggler.showAndFocus(); + } + }); BrowserWindowModule.registerUeliCommandEvents(browserWindow, eventSubscriber, browserWindowToggler); }