diff src/video/wincommon/SDL_sysevents.c @ 304:ec53caed9fb2

*** empty log message ***
author Sam Lantinga <slouken@libsdl.org>
date Sun, 10 Mar 2002 03:25:47 +0000
parents e8157fcb3114
children 13fc64213765
line wrap: on
line diff
--- a/src/video/wincommon/SDL_sysevents.c	Thu Mar 07 20:29:04 2002 +0000
+++ b/src/video/wincommon/SDL_sysevents.c	Sun Mar 10 03:25:47 2002 +0000
@@ -57,6 +57,9 @@
 int SDL_resizing = 0;
 int mouse_relative = 0;
 int posted = 0;
+#ifndef NO_CHANGEDISPLAYSETTINGS
+DEVMODE SDL_fullscreen_mode;
+#endif
 
 
 /* Functions called by the message processing function */
@@ -67,6 +70,21 @@
 void (*WIN_SwapGamma)(_THIS);
 void (*WIN_WinPAINT)(_THIS, HDC hdc);
 
+static void SDL_RestoreGameMode(void)
+{
+#ifndef NO_CHANGEDISPLAYSETTINGS
+	ShowWindow(SDL_Window, SW_RESTORE);
+	ChangeDisplaySettings(&SDL_fullscreen_mode, CDS_FULLSCREEN);
+#endif
+}
+static void SDL_RestoreDesktopMode(void)
+{
+#ifndef NO_CHANGEDISPLAYSETTINGS
+	ShowWindow(SDL_Window, SW_MINIMIZE);
+	ChangeDisplaySettings(NULL, 0);
+#endif
+}
+
 #ifdef WM_MOUSELEAVE
 /* 
    Special code to handle mouse leave events - this sucks...
@@ -178,6 +196,9 @@
 				}
 				if ( !(SDL_GetAppState()&SDL_APPINPUTFOCUS) ) {
 					WIN_SwapGamma(this);
+					if ( WINDIB_FULLSCREEN() ) {
+						SDL_RestoreGameMode();
+					}
 				}
 				posted = SDL_PrivateAppActive(1, appstate);
 				WIN_GetKeyboardState();
@@ -192,6 +213,9 @@
 				}
 				if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
 					WIN_SwapGamma(this);
+					if ( WINDIB_FULLSCREEN() ) {
+						SDL_RestoreDesktopMode();
+					}
 				}
 				posted = SDL_PrivateAppActive(0, appstate);
 			}