Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed showing and hiding fullscreen windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 1, 2010
1 parent 23c0263 commit d1feac4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/video/SDL_sysvideo.h
Expand Up @@ -182,7 +182,6 @@ struct SDL_VideoDisplay
int num_render_drivers;
SDL_RenderDriver *render_drivers;

int num_windows;
SDL_Window *windows;
SDL_Window *fullscreen_window;

Expand Down
12 changes: 5 additions & 7 deletions src/video/SDL_video.c
Expand Up @@ -110,7 +110,7 @@ static SDL_VideoDevice *_this = NULL;
SDL_UninitializedVideo(); \
return retval; \
} \
if (!window || window->magic != &_this->window_magic) { \
if (!window || window->magic != &_this->window_magic) { \
SDL_SetError("Invalid window"); \
return retval; \
}
Expand All @@ -120,7 +120,7 @@ static SDL_VideoDevice *_this = NULL;
SDL_UninitializedVideo(); \
return retval; \
} \
if (!texture || texture->magic != &_this->texture_magic) { \
if (!texture || texture->magic != &_this->texture_magic) { \
SDL_SetError("Invalid texture"); \
return retval; \
}
Expand Down Expand Up @@ -772,7 +772,6 @@ static void
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) {
Expand All @@ -799,8 +798,8 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool attempt)

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);
}
Expand All @@ -810,8 +809,7 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool attempt)
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) {
Expand Down

0 comments on commit d1feac4

Please sign in to comment.