Fix multi-monitor window centering

This commit is contained in:
Melody Madeline Lyons 2024-07-05 05:50:53 -07:00
parent 67b98534d7
commit 189395a72c
No known key found for this signature in database
GPG key ID: B6C584DC39E7598C

View file

@ -500,13 +500,16 @@ void EventThread::process(RGSSThreadData &rtData)
rtData.rqWindowAdjust.clear(); rtData.rqWindowAdjust.clear();
break; break;
case REQUEST_WINCENTER : case REQUEST_WINCENTER : {
rc = SDL_GetDesktopDisplayMode(SDL_GetWindowDisplayIndex(win), &dm); rc = SDL_GetDesktopDisplayMode(SDL_GetWindowDisplayIndex(win), &dm);
if (!rc) SDL_Rect rect;
SDL_SetWindowPosition(win, SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(win), &rect);
(dm.w / 2) - (winW / 2), if (!rc)
(dm.h / 2) - (winH / 2)); SDL_SetWindowPosition(win,
rtData.rqWindowAdjust.clear(); rect.x + (dm.w / 2) - (winW / 2),
rect.y + (dm.h / 2) - (winH / 2));
rtData.rqWindowAdjust.clear();
}
break; break;
case REQUEST_WINRENAME : case REQUEST_WINRENAME :