Fixed bug 3202 - Fix renderer visibility on a window maximized directly from the minimized state
authorDavid Ludwig <dludwig@pobox.com>
Sun, 27 Dec 2015 17:55:45 -0500
changeset 99680a420ec24b6a
parent 9967 75871b5e0bc6
child 9969 be3d04927338
Fixed bug 3202 - Fix renderer visibility on a window maximized directly from the minimized state

Many thanks to id.zeta for details on the bug, and for the fix!
src/events/SDL_windowevents.c
src/render/SDL_render.c
     1.1 --- a/src/events/SDL_windowevents.c	Sun Dec 27 16:46:12 2015 -0500
     1.2 +++ b/src/events/SDL_windowevents.c	Sun Dec 27 17:55:45 2015 -0500
     1.3 @@ -127,6 +127,7 @@
     1.4          if (window->flags & SDL_WINDOW_MINIMIZED) {
     1.5              return 0;
     1.6          }
     1.7 +        window->flags &= ~SDL_WINDOW_MAXIMIZED;
     1.8          window->flags |= SDL_WINDOW_MINIMIZED;
     1.9          SDL_OnWindowMinimized(window);
    1.10          break;
    1.11 @@ -134,6 +135,7 @@
    1.12          if (window->flags & SDL_WINDOW_MAXIMIZED) {
    1.13              return 0;
    1.14          }
    1.15 +        window->flags &= ~SDL_WINDOW_MINIMIZED;
    1.16          window->flags |= SDL_WINDOW_MAXIMIZED;
    1.17          break;
    1.18      case SDL_WINDOWEVENT_RESTORED:
     2.1 --- a/src/render/SDL_render.c	Sun Dec 27 16:46:12 2015 -0500
     2.2 +++ b/src/render/SDL_render.c	Sun Dec 27 17:55:45 2015 -0500
     2.3 @@ -158,7 +158,8 @@
     2.4                  }
     2.5              } else if (event->window.event == SDL_WINDOWEVENT_MINIMIZED) {
     2.6                  renderer->hidden = SDL_TRUE;
     2.7 -            } else if (event->window.event == SDL_WINDOWEVENT_RESTORED) {
     2.8 +            } else if (event->window.event == SDL_WINDOWEVENT_RESTORED || 
     2.9 +                       event->window.event == SDL_WINDOWEVENT_MAXIMIZED) {
    2.10                  if (!(SDL_GetWindowFlags(window) & SDL_WINDOW_HIDDEN)) {
    2.11                      renderer->hidden = SDL_FALSE;
    2.12                  }