If we're fullscreen on a single-head system and lose focus, minimize
authorSam Lantinga <slouken@libsdl.org>
Wed, 02 Dec 2009 07:42:10 +0000
changeset 3512 5ffbbfb78987
parent 3511 42cfa69e351b
child 3513 b66c9e8090d4
If we're fullscreen on a single-head system and lose focus, minimize
src/video/SDL_video.c
--- 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);
     }