comparison src/video/x11/SDL_x11mouse.c @ 1740:db7e15a99cb3

Fixed bug #101 If we lose focus at all, unlock the mouse.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 27 Apr 2006 10:44:43 +0000
parents 3ba88cb7eb1b
children 782fd950bd46 c121d94672cb 79a4c9017550
comparison
equal deleted inserted replaced
1739:3a3e847aadb9 1740:db7e15a99cb3
224 } 224 }
225 225
226 /* Check to see if we need to enter or leave mouse relative mode */ 226 /* Check to see if we need to enter or leave mouse relative mode */
227 void X11_CheckMouseModeNoLock(_THIS) 227 void X11_CheckMouseModeNoLock(_THIS)
228 { 228 {
229 const Uint8 full_focus = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
229 char *env_override; 230 char *env_override;
230 int enable_relative = 1; 231 int enable_relative = 1;
231 232
232 /* Allow the user to override the relative mouse mode. 233 /* Allow the user to override the relative mouse mode.
233 They almost never want to do this, as it seriously affects 234 They almost never want to do this, as it seriously affects
240 241
241 /* If the mouse is hidden and input is grabbed, we use relative mode */ 242 /* If the mouse is hidden and input is grabbed, we use relative mode */
242 if ( enable_relative && 243 if ( enable_relative &&
243 !(SDL_cursorstate & CURSOR_VISIBLE) && 244 !(SDL_cursorstate & CURSOR_VISIBLE) &&
244 (this->input_grab != SDL_GRAB_OFF) && 245 (this->input_grab != SDL_GRAB_OFF) &&
245 (SDL_GetAppState() & SDL_APPACTIVE) ) { 246 (SDL_GetAppState() & full_focus) == full_focus ) {
246 if ( ! mouse_relative ) { 247 if ( ! mouse_relative ) {
247 X11_EnableDGAMouse(this); 248 X11_EnableDGAMouse(this);
248 if ( ! (using_dga & DGA_MOUSE) ) { 249 if ( ! (using_dga & DGA_MOUSE) ) {
249 char *xmouse_accel; 250 char *xmouse_accel;
250 251