comparison src/video/x11/SDL_x11events.c @ 4255:5a203e2b0162 SDL-1.2

Fixed bug #716 Armin Burgmeier 2009-03-15 04:35:45 PDT When I hold a mouse button down on another (non-SDL) window, then move the mouse over an SDL window and releasing the mouse button there, then the application does not receive an SDL_ACTIVEEVENT with state SDL_APPMOUSEFOCUS and gain 1. Furthermore, SDL_GetAppState() reports the application not having mouse focus until moving the mouse out of the window and back in again.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 27 Sep 2009 23:22:57 +0000
parents a1b03ba2fcd0
children d6f4cc9a5bf6
comparison
equal deleted inserted replaced
4254:8afecb86be35 4255:5a203e2b0162
421 if ( xevent.xcrossing.mode == NotifyGrab ) 421 if ( xevent.xcrossing.mode == NotifyGrab )
422 printf("Mode: NotifyGrab\n"); 422 printf("Mode: NotifyGrab\n");
423 if ( xevent.xcrossing.mode == NotifyUngrab ) 423 if ( xevent.xcrossing.mode == NotifyUngrab )
424 printf("Mode: NotifyUngrab\n"); 424 printf("Mode: NotifyUngrab\n");
425 #endif 425 #endif
426 if ( (xevent.xcrossing.mode != NotifyGrab) && 426 if ( this->input_grab == SDL_GRAB_OFF ) {
427 (xevent.xcrossing.mode != NotifyUngrab) ) { 427 posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
428 if ( this->input_grab == SDL_GRAB_OFF ) { 428 }
429 posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); 429 posted = SDL_PrivateMouseMotion(0, 0,
430 } 430 xevent.xcrossing.x,
431 posted = SDL_PrivateMouseMotion(0, 0, 431 xevent.xcrossing.y);
432 xevent.xcrossing.x,
433 xevent.xcrossing.y);
434 }
435 } 432 }
436 break; 433 break;
437 434
438 /* Losing mouse coverage? */ 435 /* Losing mouse coverage? */
439 case LeaveNotify: { 436 case LeaveNotify: {
442 if ( xevent.xcrossing.mode == NotifyGrab ) 439 if ( xevent.xcrossing.mode == NotifyGrab )
443 printf("Mode: NotifyGrab\n"); 440 printf("Mode: NotifyGrab\n");
444 if ( xevent.xcrossing.mode == NotifyUngrab ) 441 if ( xevent.xcrossing.mode == NotifyUngrab )
445 printf("Mode: NotifyUngrab\n"); 442 printf("Mode: NotifyUngrab\n");
446 #endif 443 #endif
447 if ( (xevent.xcrossing.mode != NotifyGrab) && 444 if ( xevent.xcrossing.detail != NotifyInferior ) {
448 (xevent.xcrossing.mode != NotifyUngrab) &&
449 (xevent.xcrossing.detail != NotifyInferior) ) {
450 if ( this->input_grab == SDL_GRAB_OFF ) { 445 if ( this->input_grab == SDL_GRAB_OFF ) {
451 posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS); 446 posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
452 } else { 447 } else {
453 posted = SDL_PrivateMouseMotion(0, 0, 448 posted = SDL_PrivateMouseMotion(0, 0,
454 xevent.xcrossing.x, 449 xevent.xcrossing.x,