800x600 minimum resolution and exit fullscreen fix

This commit is contained in:
pk-2000 2021-01-15 11:29:58 +02:00 committed by GitHub
parent 0252112a98
commit 657da03823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -128,8 +128,8 @@ void EventThread::process(RGSSThreadData &rtData)
defScreenH = rtData.config.defScreenH; defScreenH = rtData.config.defScreenH;
SDL_GetDesktopDisplayMode(0, &dm); SDL_GetDesktopDisplayMode(0, &dm);
SDL_SetWindowMaximumSize(win, dm.w, dm.h); SDL_SetWindowMaximumSize(win, dm.w, dm.h);
SDL_SetWindowMinimumSize(win, 256, 192); SDL_SetWindowMinimumSize(win, 800, 600);
SDL_SetWindowSize(win, 256, 192); SDL_SetWindowSize(win, 800, 600);
int defScreenW_new, defScreenH_new; int defScreenW_new, defScreenH_new;
int firstrun; int firstrun;
firstrun = 0; firstrun = 0;
@ -279,6 +279,11 @@ void EventThread::process(RGSSThreadData &rtData)
if (event.key.keysym.scancode == SDL_SCANCODE_RETURN && if (event.key.keysym.scancode == SDL_SCANCODE_RETURN &&
(event.key.keysym.mod & toggleFSMod)) (event.key.keysym.mod & toggleFSMod))
{ {
if (!fullscreen && firstrun < 2)
{
firstrun = 2;
SDL_SetWindowPosition(win, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
}
setFullscreen(win, !fullscreen); setFullscreen(win, !fullscreen);
if (!fullscreen && havePendingTitle) if (!fullscreen && havePendingTitle)
{ {
@ -291,6 +296,11 @@ void EventThread::process(RGSSThreadData &rtData)
{ {
SDL_SetWindowSize(win, defScreenW_new, defScreenH_new); SDL_SetWindowSize(win, defScreenW_new, defScreenH_new);
} }
if (firstrun < 2)
{
firstrun = 2;
SDL_SetWindowPosition(win, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
}
break; break;
} }