get proper fullscreen with the unlocked unlocked settings (to review later on)

This commit is contained in:
pk-2000 2020-04-14 14:55:00 +03:00 committed by GitHub
parent 48cf89cdbc
commit e436dac1e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -106,6 +106,8 @@ EventThread::EventThread()
showCursor(false) showCursor(false)
{} {}
SDL_DisplayMode dm = {0};
void EventThread::process(RGSSThreadData &rtData) void EventThread::process(RGSSThreadData &rtData)
{ {
SDL_Event event; SDL_Event event;
@ -541,6 +543,9 @@ void EventThread::resetInputStates()
void EventThread::setFullscreen(SDL_Window *win, bool mode) void EventThread::setFullscreen(SDL_Window *win, bool mode)
{ {
SDL_GetDesktopDisplayMode(0, &dm);
SDL_SetWindowSize(win, dm.w, dm.h);
SDL_WINDOWEVENT_SIZE_CHANGED;
SDL_SetWindowFullscreen SDL_SetWindowFullscreen
(win, mode ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); (win, mode ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
fullscreen = mode; fullscreen = mode;