-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window state not persisted anymore #64
Comments
Same here, specifying custom To fix this issue I took this code and modified it to my linking and it works well (for me). I also added a |
Thanks, setting it manually does seem to work: win.on('resize', debounce(mainWindowState.saveState, 500))
win.on('move', debounce(mainWindowState.saveState, 500)) Leaving the issue open because seems the default way with |
In my case the state is not persisted between updates of the app, I'll try the |
I had to do: const debouncedSaveWindowState = debounce(
(event: any) => mainWindowState.saveState(event.sender),
500
)
mainWindow.on('resize', debouncedSaveWindowState)
mainWindow.on('move', debouncedSaveWindowState) @Christilut's code assumes that the window is sent as argument to |
It works persistently on Windows and Mac on my side after I changed the On my windows laptop this condition state.y + state.height <= bounds.y + bounds.height would always be false if I set defaultHeight to 768. |
Since a while (maybe since Electron 11), the window state does not persist anymore. The json file is not created anymore so my window state resets every time.
I tried giving it a different path but does not seem to work either.
The text was updated successfully, but these errors were encountered: