Fixed showing and hiding fullscreen windows
authorSam Lantinga <slouken@libsdl.org>
Mon, 01 Feb 2010 01:19:37 +0000
changeset 3701fb905d5674cc
parent 3700 076c12750bc4
child 3702 6604099437ac
Fixed showing and hiding fullscreen windows
src/video/SDL_sysvideo.h
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_sysvideo.h	Wed Jan 27 05:14:22 2010 +0000
     1.2 +++ b/src/video/SDL_sysvideo.h	Mon Feb 01 01:19:37 2010 +0000
     1.3 @@ -182,7 +182,6 @@
     1.4      int num_render_drivers;
     1.5      SDL_RenderDriver *render_drivers;
     1.6  
     1.7 -    int num_windows;
     1.8      SDL_Window *windows;
     1.9      SDL_Window *fullscreen_window;
    1.10  
     2.1 --- a/src/video/SDL_video.c	Wed Jan 27 05:14:22 2010 +0000
     2.2 +++ b/src/video/SDL_video.c	Mon Feb 01 01:19:37 2010 +0000
     2.3 @@ -110,7 +110,7 @@
     2.4          SDL_UninitializedVideo(); \
     2.5          return retval; \
     2.6      } \
     2.7 -	if (!window || window->magic != &_this->window_magic) { \
     2.8 +    if (!window || window->magic != &_this->window_magic) { \
     2.9          SDL_SetError("Invalid window"); \
    2.10          return retval; \
    2.11      }
    2.12 @@ -120,7 +120,7 @@
    2.13          SDL_UninitializedVideo(); \
    2.14          return retval; \
    2.15      } \
    2.16 -	if (!texture || texture->magic != &_this->texture_magic) { \
    2.17 +    if (!texture || texture->magic != &_this->texture_magic) { \
    2.18          SDL_SetError("Invalid texture"); \
    2.19          return retval; \
    2.20      }
    2.21 @@ -772,7 +772,6 @@
    2.22  SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool attempt)
    2.23  {
    2.24      SDL_VideoDisplay *display = window->display;
    2.25 -    int i;
    2.26  
    2.27      /* See if we're already processing a window */
    2.28      if (display->updating_fullscreen) {
    2.29 @@ -799,8 +798,8 @@
    2.30  
    2.31      if (FULLSCREEN_VISIBLE(window)) {
    2.32          /* Hide any other fullscreen windows */
    2.33 -        for (i = 0; i < display->num_windows; ++i) {
    2.34 -            SDL_Window *other = &display->windows[i];
    2.35 +        SDL_Window *other;
    2.36 +        for (other = display->windows; other; other = other->next) {
    2.37              if (other != window && FULLSCREEN_VISIBLE(other)) {
    2.38                  SDL_MinimizeWindow(other);
    2.39              }
    2.40 @@ -810,8 +809,7 @@
    2.41      display->updating_fullscreen = SDL_FALSE;
    2.42  
    2.43      /* See if there are any fullscreen windows */
    2.44 -    for (i = 0; i < display->num_windows; ++i) {
    2.45 -        window = &display->windows[i];
    2.46 +    for (window = display->windows; window; window = window->next) {
    2.47          if (FULLSCREEN_VISIBLE(window)) {
    2.48              SDL_DisplayMode fullscreen_mode;
    2.49              if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) {