-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Restore windows position when app is restarted #626
Conversation
8e705e2
to
6ae7cfd
Compare
@@ -314,6 +314,8 @@ function dispatch (action, ...args) { | |||
saveStateThrottled() | |||
} | |||
if (action === 'saveState') { | |||
state.saved.window = state.saved.window || {} | |||
state.saved.window.bounds = args[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid dispatching bounds as an argument we could do something like this instead:
{ x: window.screenX, y: window.screenY, width: window.outerWidth, height: window.outerHeight }
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with your suggestion, did not notice that window was a available in the renderer. Dispatching bounds is more cumbersome.
Hi, I added some comments to your PR. However an alternative to the current approach could be to always load the window with default settings, and then dispatch the bounds back from renderer/main.js during initialization. This way we could avoid adding Probably need more opinions on this though! 😅 |
Thanks for the feedback! I agree the line comments you shared. Maybe not including If we decide to go with this PR, I can fix the minor issues you pointed out in your comments. |
If the movement is visible I think loading |
Closing this PR as this was fixed in #827 👍 |
Closes issue #181.
I am not sure about the cleanness of reading saved state in the main window module, feedback/alternative approaches are more than welcome :)