comparison src/video/x11/SDL_x11wm.c @ 88:71774090f286

Hopefully fixed the fullscreen mode code for KDE
author Sam Lantinga <slouken@lokigames.com>
date Sat, 07 Jul 2001 07:59:37 +0000
parents 74212992fb08
children 8a5aff5c1294
comparison
equal deleted inserted replaced
87:3ef4bc90c388 88:71774090f286
256 for ( numtries = 0; numtries < 10; ++numtries ) { 256 for ( numtries = 0; numtries < 10; ++numtries ) {
257 result = XGrabPointer(SDL_Display, FSwindow, 257 result = XGrabPointer(SDL_Display, FSwindow,
258 True, 0, 258 True, 0,
259 GrabModeAsync, GrabModeAsync, 259 GrabModeAsync, GrabModeAsync,
260 FSwindow, None, CurrentTime); 260 FSwindow, None, CurrentTime);
261 if ( result == AlreadyGrabbed ) { 261 if ( result == GrabSuccess ) {
262 break; 262 break;
263 } 263 }
264 SDL_Delay(100); 264 SDL_Delay(100);
265 } 265 }
266 } 266 if ( result != GrabSuccess ) {
267 #ifdef GRAB_FULLSCREEN 267 /* Uh, oh, what do we do here? */ ;
268 }
269 }
268 if ( !(this->screen->flags & SDL_FULLSCREEN) ) 270 if ( !(this->screen->flags & SDL_FULLSCREEN) )
269 #endif 271 XUngrabKeyboard(SDL_Display, CurrentTime);
270 XUngrabKeyboard(SDL_Display, CurrentTime);
271 } else { 272 } else {
272 if ( this->screen->flags & SDL_FULLSCREEN ) { 273 if ( this->screen->flags & SDL_FULLSCREEN ) {
273 /* Unbind the mouse from the fullscreen window */ 274 /* Unbind the mouse from the fullscreen window */
274 XUngrabPointer(SDL_Display, CurrentTime); 275 XUngrabPointer(SDL_Display, CurrentTime);
275 } 276 }
276 /* Try to grab the mouse */ 277 /* Try to grab the mouse */
277 for ( numtries = 0; numtries < 10; ++numtries ) { 278 for ( numtries = 0; numtries < 10; ++numtries ) {
278 result = XGrabPointer(SDL_Display, SDL_Window, True, 0, 279 result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
279 GrabModeAsync, GrabModeAsync, 280 GrabModeAsync, GrabModeAsync,
280 SDL_Window, None, CurrentTime); 281 SDL_Window, None, CurrentTime);
281 if ( result != AlreadyGrabbed ) { 282 if ( result == GrabSuccess ) {
282 break; 283 break;
283 } 284 }
284 SDL_Delay(100); 285 SDL_Delay(100);
285 } 286 }
286 #ifdef GRAB_FULLSCREEN 287 if ( result != GrabSuccess ) {
287 if ( !(this->screen->flags & SDL_FULLSCREEN) ) 288 /* Uh, oh, what do we do here? */ ;
288 #endif 289 }
289 XGrabKeyboard(SDL_Display, WMwindow, True, 290 /* Grab the keyboard if we're in fullscreen mode */
290 GrabModeAsync, GrabModeAsync, CurrentTime); 291 if ( !(this->screen->flags & SDL_FULLSCREEN) ) {
292 XGrabKeyboard(SDL_Display, WMwindow, True,
293 GrabModeAsync, GrabModeAsync, CurrentTime);
294 SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
295 }
291 296
292 /* Raise the window if we grab the mouse */ 297 /* Raise the window if we grab the mouse */
293 if ( !(this->screen->flags & SDL_FULLSCREEN) ) 298 if ( !(this->screen->flags & SDL_FULLSCREEN) )
294 XRaiseWindow(SDL_Display, WMwindow); 299 XRaiseWindow(SDL_Display, WMwindow);
295 } 300 }