erkyrath / lectrote

The IF interpreter in an Electron shell
Other
248 stars 28 forks source link

[Windows] Window maximisation status is not remembered #103

Open curiousdannii opened 6 years ago

curiousdannii commented 6 years ago

In Windows, if you maximise a window, then when you reopen Lectrote the window tries to open with the same or similar dimensions, but not maximised. The top/left of the window will be offscreen, and the right/bottom will be some distance away from the screen edges.

I think fixing this will involve listening to the maximize and unmaximize events, storing in the prefs file, and calling maximize() after creating the BrowserWindow (there's no option to pass.)

As a bonus, I wonder if it would be possible to remember the non-maximised window sizes across app instances. Or maybe if you maximise the window then it could wipe the height and width options so that when you unmaximise it, it won't just go to a non-maximised window of the same size (with likely offscreen side-effects.)

erkyrath commented 6 years ago

I think the right behavior is to never store the maximized size in the preferences -- only the non-maximized size and a boolean "maximized" flag.

Then, as you say, call maximize() on launch.