Skip to content
Permalink
Browse files

Fixed bug 3202 - Fix renderer visibility on a window maximized direct…

…ly from the minimized state

Many thanks to id.zeta for details on the bug, and for the fix!
  • Loading branch information
DavidLudwig committed Dec 27, 2015
1 parent faed058 commit 9e9ef5ad3181b4f72098a5162944cd0d37032ca7
Showing with 4 additions and 1 deletion.
  1. +2 −0 src/events/SDL_windowevents.c
  2. +2 −1 src/render/SDL_render.c
@@ -127,13 +127,15 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
if (window->flags & SDL_WINDOW_MINIMIZED) {
return 0;
}
window->flags &= ~SDL_WINDOW_MAXIMIZED;
window->flags |= SDL_WINDOW_MINIMIZED;
SDL_OnWindowMinimized(window);
break;
case SDL_WINDOWEVENT_MAXIMIZED:
if (window->flags & SDL_WINDOW_MAXIMIZED) {
return 0;
}
window->flags &= ~SDL_WINDOW_MINIMIZED;
window->flags |= SDL_WINDOW_MAXIMIZED;
break;
case SDL_WINDOWEVENT_RESTORED:
@@ -158,7 +158,8 @@ SDL_RendererEventWatch(void *userdata, SDL_Event *event)
}
} else if (event->window.event == SDL_WINDOWEVENT_MINIMIZED) {
renderer->hidden = SDL_TRUE;
} else if (event->window.event == SDL_WINDOWEVENT_RESTORED) {
} else if (event->window.event == SDL_WINDOWEVENT_RESTORED ||
event->window.event == SDL_WINDOWEVENT_MAXIMIZED) {
if (!(SDL_GetWindowFlags(window) & SDL_WINDOW_HIDDEN)) {
renderer->hidden = SDL_FALSE;
}

0 comments on commit 9e9ef5a

Please sign in to comment.