mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 21:43:06 +01:00
Fix #16989: Re-focusing maximised window triggers a restore and maximise
Fixes #16989 by removing an SDL hack. Originally added to address issue #2158, I can't reproduce this issue with the hack removed. Tested on Linux (by CorySanin) and Windows (by Broxzier).
This commit is contained in:
@@ -339,23 +339,6 @@ public:
|
||||
context_quit();
|
||||
break;
|
||||
case SDL_WINDOWEVENT:
|
||||
// HACK: Fix #2158, OpenRCT2 does not draw if it does not think that the window is
|
||||
// visible - due a bug in SDL 2.0.3 this hack is required if the
|
||||
// window is maximised, minimised and then restored again.
|
||||
if (e.window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
|
||||
{
|
||||
if (SDL_GetWindowFlags(_window) & SDL_WINDOW_MAXIMIZED)
|
||||
{
|
||||
SDL_RestoreWindow(_window);
|
||||
SDL_MaximizeWindow(_window);
|
||||
}
|
||||
if ((SDL_GetWindowFlags(_window) & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP)
|
||||
{
|
||||
SDL_RestoreWindow(_window);
|
||||
SDL_SetWindowFullscreen(_window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
}
|
||||
}
|
||||
|
||||
if (e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)
|
||||
{
|
||||
OnResize(e.window.data1, e.window.data2);
|
||||
|
||||
Reference in New Issue
Block a user