diff src/video/x11/SDL_x11mouse.c @ 1657:5b0805ceb50f SDL-1.3

Merge trunk-1.3-2
author Sam Lantinga <slouken@libsdl.org>
date Fri, 28 Apr 2006 16:55:41 +0000
parents 3ba88cb7eb1b
children 782fd950bd46 c121d94672cb 79a4c9017550
line wrap: on
line diff
--- a/src/video/x11/SDL_x11mouse.c	Thu Apr 27 09:09:48 2006 +0000
+++ b/src/video/x11/SDL_x11mouse.c	Fri Apr 28 16:55:41 2006 +0000
@@ -226,6 +226,7 @@
 /* Check to see if we need to enter or leave mouse relative mode */
 void X11_CheckMouseModeNoLock(_THIS)
 {
+	const Uint8 full_focus = (SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
 	char *env_override;
 	int enable_relative = 1;
 
@@ -242,7 +243,7 @@
 	if ( enable_relative &&
 	     !(SDL_cursorstate & CURSOR_VISIBLE) &&
 	     (this->input_grab != SDL_GRAB_OFF) &&
-             (SDL_GetAppState() & SDL_APPACTIVE) ) {
+             (SDL_GetAppState() & full_focus) == full_focus ) {
 		if ( ! mouse_relative ) {
 			X11_EnableDGAMouse(this);
 			if ( ! (using_dga & DGA_MOUSE) ) {