changeset 3512:5ffbbfb78987

If we're fullscreen on a single-head system and lose focus, minimize
author Sam Lantinga <slouken@libsdl.org>
date Wed, 02 Dec 2009 07:42:10 +0000
parents 42cfa69e351b
children b66c9e8090d4
files src/video/SDL_video.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/SDL_video.c	Wed Dec 02 07:38:28 2009 +0000
+++ b/src/video/SDL_video.c	Wed Dec 02 07:42:10 2009 +0000
@@ -1449,6 +1449,12 @@
 {
     SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
 
+    /* If we're fullscreen on a single-head system and lose focus, minimize */
+    if ((window->flags & SDL_WINDOW_FULLSCREEN) &&
+        _this->num_displays == 1) {
+        SDL_MinimizeWindow(window->id);
+    }
+
     if (display->gamma && _this->SetDisplayGammaRamp) {
         _this->SetDisplayGammaRamp(_this, display, display->saved_gamma);
     }