Window size is forgotten in some circumstances
Description
The window size of files does not seem to be fixed. If I adjust the window size to my preferred size, the window size seems to alter itself, most notably in the height of the window.
Link to an example: See linked video
Versions
- MarkText version: 0.16.3
- Operating system: Windows 10
There is definitely a bug with saving and restoration of the window size between uses. This bug still persists in version 0.17.1. Every time MarkText is launched, the window grows in size from the previous time it was used, both vertically and horizontally.
I have observed that the amount the window grows in size horizontally appears to correspond to the width of a standard scroll bar, and the amount grown in size vertically corresponds to the combined height of the window title plus menu bar.
Investigating further, I see that the window state is saved to %APPDATA%\marktext\window-state.json upon application exit. It appears the problem is two-fold: both the width/height values saved are incorrect and a new window is not restored to precisely the saved width height/values.
An example:
- At the time of exiting, MarkText window is 660x707 pixels (verified by screenshot and measurement in an image editor).
- The saved window state is:
As you can see, inaccurate width and height values are saved.{"width":674,"height":714,"x":244,"y":149,"isMaximized":false,"isFullScreen":false,"displayBounds":{"x":0,"y":0,"width":1920,"height":1200}} - After closing that MarkText instance and re-launching, the new window is now 676x766, which also does not match the saved values.
If I had to guess at the cause of this bug, I would guess it's something to do with some mix-up between window overall size versus size of client area (i.e. the area excluding title, menu bar, and window borders).
This is with Windows 10 22H2 19045.5854.