mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
Merge branch 'feat/issue-7276-ceefd0'
* feat/issue-7276-ceefd0: fix(window): preserve maximized state for shortcut hide
This commit is contained in:
commit
a7b773df0c
2 changed files with 3 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { globalShortcut, ipcMain } from 'electron';
|
||||
import { IPC } from '../shared-with-frontend/ipc-events.const';
|
||||
import { KeyboardConfig } from '../../src/app/features/config/keyboard-config.model';
|
||||
import { getWin } from '../main-window';
|
||||
import { getWin, setWasMaximizedBeforeHide } from '../main-window';
|
||||
import { showOrFocus } from '../various-shared';
|
||||
import { ensureIndicator } from '../indicator';
|
||||
import { getIsMinimizeToTray } from '../shared-state';
|
||||
|
|
@ -49,6 +49,7 @@ const registerShowAppShortCuts = (cfg: KeyboardConfig): void => {
|
|||
// tray was successfully (re)created; otherwise minimize so a
|
||||
// taskbar handle remains as a safety net. blur() is a Windows
|
||||
// focus workaround (electron#20464) and a no-op elsewhere.
|
||||
setWasMaximizedBeforeHide(mainWin.isMaximized());
|
||||
if (IS_MAC) {
|
||||
mainWin.hide();
|
||||
} else if (getIsMinimizeToTray() && ensureIndicator()) {
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ export const createWindow = async ({
|
|||
});
|
||||
|
||||
mainWindowState.manage(mainWin);
|
||||
setWasMaximizedBeforeHide(mainWin.isMaximized());
|
||||
|
||||
// Fix for #7276: electron-window-state saves state in its `closed` handler,
|
||||
// which calls win.isMaximized() on an already-hidden window (tray/shortcut
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue