comparison 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
comparison
equal deleted inserted replaced
303:767c10b9ec9f 304:ec53caed9fb2
55 HWND SDL_Window = NULL; 55 HWND SDL_Window = NULL;
56 RECT SDL_bounds = {0, 0, 0, 0}; 56 RECT SDL_bounds = {0, 0, 0, 0};
57 int SDL_resizing = 0; 57 int SDL_resizing = 0;
58 int mouse_relative = 0; 58 int mouse_relative = 0;
59 int posted = 0; 59 int posted = 0;
60 #ifndef NO_CHANGEDISPLAYSETTINGS
61 DEVMODE SDL_fullscreen_mode;
62 #endif
60 63
61 64
62 /* Functions called by the message processing function */ 65 /* Functions called by the message processing function */
63 LONG 66 LONG
64 (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL; 67 (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL;
65 void (*WIN_RealizePalette)(_THIS); 68 void (*WIN_RealizePalette)(_THIS);
66 void (*WIN_PaletteChanged)(_THIS, HWND window); 69 void (*WIN_PaletteChanged)(_THIS, HWND window);
67 void (*WIN_SwapGamma)(_THIS); 70 void (*WIN_SwapGamma)(_THIS);
68 void (*WIN_WinPAINT)(_THIS, HDC hdc); 71 void (*WIN_WinPAINT)(_THIS, HDC hdc);
72
73 static void SDL_RestoreGameMode(void)
74 {
75 #ifndef NO_CHANGEDISPLAYSETTINGS
76 ShowWindow(SDL_Window, SW_RESTORE);
77 ChangeDisplaySettings(&SDL_fullscreen_mode, CDS_FULLSCREEN);
78 #endif
79 }
80 static void SDL_RestoreDesktopMode(void)
81 {
82 #ifndef NO_CHANGEDISPLAYSETTINGS
83 ShowWindow(SDL_Window, SW_MINIMIZE);
84 ChangeDisplaySettings(NULL, 0);
85 #endif
86 }
69 87
70 #ifdef WM_MOUSELEAVE 88 #ifdef WM_MOUSELEAVE
71 /* 89 /*
72 Special code to handle mouse leave events - this sucks... 90 Special code to handle mouse leave events - this sucks...
73 http://support.microsoft.com/support/kb/articles/q183/1/07.asp 91 http://support.microsoft.com/support/kb/articles/q183/1/07.asp
176 if ( this->input_grab != SDL_GRAB_OFF ) { 194 if ( this->input_grab != SDL_GRAB_OFF ) {
177 WIN_GrabInput(this, SDL_GRAB_ON); 195 WIN_GrabInput(this, SDL_GRAB_ON);
178 } 196 }
179 if ( !(SDL_GetAppState()&SDL_APPINPUTFOCUS) ) { 197 if ( !(SDL_GetAppState()&SDL_APPINPUTFOCUS) ) {
180 WIN_SwapGamma(this); 198 WIN_SwapGamma(this);
199 if ( WINDIB_FULLSCREEN() ) {
200 SDL_RestoreGameMode();
201 }
181 } 202 }
182 posted = SDL_PrivateAppActive(1, appstate); 203 posted = SDL_PrivateAppActive(1, appstate);
183 WIN_GetKeyboardState(); 204 WIN_GetKeyboardState();
184 } else { 205 } else {
185 /* Lose the following states */ 206 /* Lose the following states */
190 if ( this->input_grab != SDL_GRAB_OFF ) { 211 if ( this->input_grab != SDL_GRAB_OFF ) {
191 WIN_GrabInput(this, SDL_GRAB_OFF); 212 WIN_GrabInput(this, SDL_GRAB_OFF);
192 } 213 }
193 if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) { 214 if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) {
194 WIN_SwapGamma(this); 215 WIN_SwapGamma(this);
216 if ( WINDIB_FULLSCREEN() ) {
217 SDL_RestoreDesktopMode();
218 }
195 } 219 }
196 posted = SDL_PrivateAppActive(0, appstate); 220 posted = SDL_PrivateAppActive(0, appstate);
197 } 221 }
198 return(0); 222 return(0);
199 } 223 }