diff src/video/SDL_video.c @ 3701:fb905d5674cc

Fixed showing and hiding fullscreen windows
author Sam Lantinga <slouken@libsdl.org>
date Mon, 01 Feb 2010 01:19:37 +0000
parents f7b03b6838cb
children 9fa97c6b0014
line wrap: on
line diff
--- a/src/video/SDL_video.c	Wed Jan 27 05:14:22 2010 +0000
+++ b/src/video/SDL_video.c	Mon Feb 01 01:19:37 2010 +0000
@@ -110,7 +110,7 @@
         SDL_UninitializedVideo(); \
         return retval; \
     } \
-	if (!window || window->magic != &_this->window_magic) { \
+    if (!window || window->magic != &_this->window_magic) { \
         SDL_SetError("Invalid window"); \
         return retval; \
     }
@@ -120,7 +120,7 @@
         SDL_UninitializedVideo(); \
         return retval; \
     } \
-	if (!texture || texture->magic != &_this->texture_magic) { \
+    if (!texture || texture->magic != &_this->texture_magic) { \
         SDL_SetError("Invalid texture"); \
         return retval; \
     }
@@ -772,7 +772,6 @@
 SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool attempt)
 {
     SDL_VideoDisplay *display = window->display;
-    int i;
 
     /* See if we're already processing a window */
     if (display->updating_fullscreen) {
@@ -799,8 +798,8 @@
 
     if (FULLSCREEN_VISIBLE(window)) {
         /* Hide any other fullscreen windows */
-        for (i = 0; i < display->num_windows; ++i) {
-            SDL_Window *other = &display->windows[i];
+        SDL_Window *other;
+        for (other = display->windows; other; other = other->next) {
             if (other != window && FULLSCREEN_VISIBLE(other)) {
                 SDL_MinimizeWindow(other);
             }
@@ -810,8 +809,7 @@
     display->updating_fullscreen = SDL_FALSE;
 
     /* See if there are any fullscreen windows */
-    for (i = 0; i < display->num_windows; ++i) {
-        window = &display->windows[i];
+    for (window = display->windows; window; window = window->next) {
         if (FULLSCREEN_VISIBLE(window)) {
             SDL_DisplayMode fullscreen_mode;
             if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) {