Skip to content

Commit

Permalink
Fixed bug #101
Browse files Browse the repository at this point in the history
If we lose focus at all, unlock the mouse.
  • Loading branch information
slouken committed Apr 27, 2006
1 parent 880b3b2 commit 5f37564
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11events.c
Expand Up @@ -666,7 +666,7 @@ void X11_PumpEvents(_THIS)
} else {
switch_time = now + 200;
}
} else if ( now >= switch_time ) {
} else if ( (int)(switch_time-now) <= 0 ) {
Uint32 go_fullscreen;

go_fullscreen = switch_waiting & SDL_FULLSCREEN;
Expand Down
3 changes: 2 additions & 1 deletion src/video/x11/SDL_x11mouse.c
Expand Up @@ -226,6 +226,7 @@ static void SetMouseAccel(_THIS, const char *accel_param)
/* 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;

Expand All @@ -242,7 +243,7 @@ void X11_CheckMouseModeNoLock(_THIS)
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) ) {
Expand Down

0 comments on commit 5f37564

Please sign in to comment.