comparison src/video/x11/SDL_x11events.c @ 3322:d9dd6cbba4c0

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:24:58 +0000
parents 08c5964f2a34
children 64ce267332c6
comparison
equal deleted inserted replaced
3321:714a352c8869 3322:d9dd6cbba4c0
91 if (xevent.xcrossing.mode == NotifyGrab) 91 if (xevent.xcrossing.mode == NotifyGrab)
92 printf("Mode: NotifyGrab\n"); 92 printf("Mode: NotifyGrab\n");
93 if (xevent.xcrossing.mode == NotifyUngrab) 93 if (xevent.xcrossing.mode == NotifyUngrab)
94 printf("Mode: NotifyUngrab\n"); 94 printf("Mode: NotifyUngrab\n");
95 #endif 95 #endif
96 if ((xevent.xcrossing.mode != NotifyGrab) &&
97 (xevent.xcrossing.mode != NotifyUngrab)) {
98 #if 1 96 #if 1
99 /* FIXME: Should we reset data for all mice? */ 97 /* FIXME: Should we reset data for all mice? */
100 for (i = 0; i < SDL_GetNumMice(); ++i) { 98 for (i = 0; i < SDL_GetNumMice(); ++i) {
101 SDL_Mouse *mouse = SDL_GetMouse(i); 99 SDL_Mouse *mouse = SDL_GetMouse(i);
102 SDL_SetMouseFocus(mouse->id, data->windowID); 100 SDL_SetMouseFocus(mouse->id, data->windowID);
103 } 101 }
104 #endif 102 #endif
105 }
106 } 103 }
107 break; 104 break;
108 105
109 /* Losing mouse coverage? */ 106 /* Losing mouse coverage? */
110 case LeaveNotify:{ 107 case LeaveNotify:{
116 if (xevent.xcrossing.mode == NotifyGrab) 113 if (xevent.xcrossing.mode == NotifyGrab)
117 printf("Mode: NotifyGrab\n"); 114 printf("Mode: NotifyGrab\n");
118 if (xevent.xcrossing.mode == NotifyUngrab) 115 if (xevent.xcrossing.mode == NotifyUngrab)
119 printf("Mode: NotifyUngrab\n"); 116 printf("Mode: NotifyUngrab\n");
120 #endif 117 #endif
121 if ((xevent.xcrossing.mode != NotifyGrab) && 118 if (xevent.xcrossing.detail != NotifyInferior) {
122 (xevent.xcrossing.mode != NotifyUngrab) &&
123 (xevent.xcrossing.detail != NotifyInferior)) {
124 #if 1 119 #if 1
125 /* FIXME: Should we reset data for all mice? */ 120 /* FIXME: Should we reset data for all mice? */
126 for (i = 0; i < SDL_GetNumMice(); ++i) { 121 for (i = 0; i < SDL_GetNumMice(); ++i) {
127 SDL_Mouse *mouse = SDL_GetMouse(i); 122 SDL_Mouse *mouse = SDL_GetMouse(i);
128 SDL_SetMouseFocus(mouse->id, 0); 123 SDL_SetMouseFocus(mouse->id, 0);
129 } 124 }
130 #endif 125 #endif
131 } 126 }
132 } 127 }
133 break; 128 break;
134 129