Window position is not correctly restored on restart on MS Windows
Closed this issue · 1 comments
Describe the bug
After restarting app, the window position is not correctly restored on MS Windows. Each time app is restarted the app window moves slightly up, causing it to finally leave screen.
Expected behavior
App window should appear with the same position as when app was closed.
Desktop (please complete the following information):
- MS Windows
Additional context
This looks to be a bug in SDL2 related to WinAPI and specifically SDL_GetWindowPosition
. It is noted also in SDL2 docs. I was not able to find a solution that is reliable and portable between various MS Windows versions, to get window position x,y and then set a new position on startup using the same x,y. It looks that position needs to be adjusted by some theme metrics like SM_CYCAPTION
or something on some MS Windows versions, but on some others not.
The problem is exposed in src.Windows/SYS_Platform.cpp
and VID_StoreMainWindowPosition
, VID_GetStartupMainWindowPosition
Possible workaround is to move window to a new position after it is spawned, not on startup - that worked in old C64 Debugger.
This is fixed and will be released with 0.64.68