adjust for window border when loading window position too
fixes window moving up every time on windows, on linux the border size gets reported as 0 so nothing changes there
This commit is contained in:
parent
743ec98e3f
commit
324602fe26
@ -84,7 +84,11 @@ void LoadWindowPosition()
|
||||
{
|
||||
int savedWindowX = Client::Ref().GetPrefInteger("WindowX", INT_MAX);
|
||||
int savedWindowY = Client::Ref().GetPrefInteger("WindowY", INT_MAX);
|
||||
SDL_SetWindowPosition(sdl_window, savedWindowX, savedWindowY);
|
||||
|
||||
int borderTop, borderLeft;
|
||||
SDL_GetWindowBordersSize(sdl_window, &borderTop, &borderLeft, nullptr, nullptr);
|
||||
|
||||
SDL_SetWindowPosition(sdl_window, savedWindowX + borderLeft, savedWindowY + borderTop);
|
||||
}
|
||||
|
||||
void SaveWindowPosition()
|
||||
|
Loading…
Reference in New Issue
Block a user