Add Graphics#restore_window

Requested by matias1lol.
This commit is contained in:
Amaryllis Kulla 2025-10-30 23:10:51 +01:00
parent 7b9d436ede
commit df9494e60c
4 changed files with 27 additions and 0 deletions

View file

@ -81,6 +81,7 @@ enum
REQUEST_SETFULLSCREEN = 0,
REQUEST_WINRESIZE,
REQUEST_WINMAXIMIZE,
REQUEST_WINRESTORE,
REQUEST_MESSAGEBOX,
REQUEST_SETCURSORVISIBLE,
@ -464,6 +465,10 @@ void EventThread::process(RGSSThreadData &rtData)
SDL_MaximizeWindow(win);
break;
case REQUEST_WINRESTORE :
SDL_RestoreWindow(win);
break;
case UPDATE_FPS :
if (rtData.config.printFPS)
Debug() << "FPS:" << event.user.code;
@ -634,6 +639,13 @@ void EventThread::requestWindowMaximize()
SDL_PushEvent(&event);
}
void EventThread::requestWindowRestore()
{
SDL_Event event;
event.type = usrIdStart + REQUEST_WINRESTORE;
SDL_PushEvent(&event);
}
void EventThread::requestShowCursor(bool mode)
{
SDL_Event event;

View file

@ -90,6 +90,7 @@ public:
void requestFullscreenMode(bool mode);
void requestWindowResize(int width, int height, bool recenter = false);
void requestWindowMaximize();
void requestWindowRestore();
void requestShowCursor(bool mode);
void requestTerminate();