src/video/wincommon/SDL_sysevents.c
changeset 304 ec53caed9fb2
parent 252 e8157fcb3114
child 327 13fc64213765
     1.1 --- a/src/video/wincommon/SDL_sysevents.c	Thu Mar 07 20:29:04 2002 +0000
     1.2 +++ b/src/video/wincommon/SDL_sysevents.c	Sun Mar 10 03:25:47 2002 +0000
     1.3 @@ -57,6 +57,9 @@
     1.4  int SDL_resizing = 0;
     1.5  int mouse_relative = 0;
     1.6  int posted = 0;
     1.7 +#ifndef NO_CHANGEDISPLAYSETTINGS
     1.8 +DEVMODE SDL_fullscreen_mode;
     1.9 +#endif
    1.10  
    1.11  
    1.12  /* Functions called by the message processing function */
    1.13 @@ -67,6 +70,21 @@
    1.14  void (*WIN_SwapGamma)(_THIS);
    1.15  void (*WIN_WinPAINT)(_THIS, HDC hdc);
    1.16  
    1.17 +static void SDL_RestoreGameMode(void)
    1.18 +{
    1.19 +#ifndef NO_CHANGEDISPLAYSETTINGS
    1.20 +	ShowWindow(SDL_Window, SW_RESTORE);
    1.21 +	ChangeDisplaySettings(&SDL_fullscreen_mode, CDS_FULLSCREEN);
    1.22 +#endif
    1.23 +}
    1.24 +static void SDL_RestoreDesktopMode(void)
    1.25 +{
    1.26 +#ifndef NO_CHANGEDISPLAYSETTINGS
    1.27 +	ShowWindow(SDL_Window, SW_MINIMIZE);
    1.28 +	ChangeDisplaySettings(NULL, 0);
    1.29 +#endif
    1.30 +}
    1.31 +
    1.32  #ifdef WM_MOUSELEAVE
    1.33  /* 
    1.34     Special code to handle mouse leave events - this sucks...
    1.35 @@ -178,6 +196,9 @@
    1.36  				}
    1.37  				if ( !(SDL_GetAppState()&SDL_APPINPUTFOCUS) ) {
    1.38  					WIN_SwapGamma(this);
    1.39 +					if ( WINDIB_FULLSCREEN() ) {
    1.40 +						SDL_RestoreGameMode();
    1.41 +					}
    1.42  				}
    1.43  				posted = SDL_PrivateAppActive(1, appstate);
    1.44  				WIN_GetKeyboardState();
    1.45 @@ -192,6 +213,9 @@
    1.46  				}
    1.47  				if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
    1.48  					WIN_SwapGamma(this);
    1.49 +					if ( WINDIB_FULLSCREEN() ) {
    1.50 +						SDL_RestoreDesktopMode();
    1.51 +					}
    1.52  				}
    1.53  				posted = SDL_PrivateAppActive(0, appstate);
    1.54  			}