mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-04-21 21:52:04 +02:00
Fix multi-monitor window centering
This commit is contained in:
parent
67b98534d7
commit
189395a72c
1 changed files with 10 additions and 7 deletions
|
@ -500,13 +500,16 @@ void EventThread::process(RGSSThreadData &rtData)
|
|||
rtData.rqWindowAdjust.clear();
|
||||
break;
|
||||
|
||||
case REQUEST_WINCENTER :
|
||||
rc = SDL_GetDesktopDisplayMode(SDL_GetWindowDisplayIndex(win), &dm);
|
||||
if (!rc)
|
||||
SDL_SetWindowPosition(win,
|
||||
(dm.w / 2) - (winW / 2),
|
||||
(dm.h / 2) - (winH / 2));
|
||||
rtData.rqWindowAdjust.clear();
|
||||
case REQUEST_WINCENTER : {
|
||||
rc = SDL_GetDesktopDisplayMode(SDL_GetWindowDisplayIndex(win), &dm);
|
||||
SDL_Rect rect;
|
||||
SDL_GetDisplayUsableBounds(SDL_GetWindowDisplayIndex(win), &rect);
|
||||
if (!rc)
|
||||
SDL_SetWindowPosition(win,
|
||||
rect.x + (dm.w / 2) - (winW / 2),
|
||||
rect.y + (dm.h / 2) - (winH / 2));
|
||||
rtData.rqWindowAdjust.clear();
|
||||
}
|
||||
break;
|
||||
|
||||
case REQUEST_WINRENAME :
|
||||
|
|
Loading…
Add table
Reference in a new issue