From 0e0b04c138b1589b3c95376a9f9d1c6693467575 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Tue, 27 Jul 2010 19:42:28 +0000 Subject: [PATCH] Fixing automatic mouse release function - still this does not seem to work in every case --- CHANGELOG.txt | 1 + arch/sdl/mouse.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b76d7189b..659446b3c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ D2X-Rebirth Changelog 20100727 -------- 2d/pcx.c, include/pcx.h, main/cntrlcen.h, main/fuelcen.h, main/gameseq.c, main/kmatrix.c: Show stars background for died in mine and secret level messageboxes; equalise fuelcen.h and cntrlcen.h +arch/sdl/mouse.c: Fixing automatic mouse release function - still this does not seem to work in every case 20100726 -------- diff --git a/arch/sdl/mouse.c b/arch/sdl/mouse.c index e49a7e762..150699a5a 100644 --- a/arch/sdl/mouse.c +++ b/arch/sdl/mouse.c @@ -251,12 +251,13 @@ void mouse_update_cursor_and_grab(fix time) { int show = SDL_ShowCursor(SDL_QUERY), grab = SDL_WM_GrabInput(SDL_QUERY); - if (!(SDL_GetAppState() & SDL_APPMOUSEFOCUS)) + if (!(SDL_GetAppState() == (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS | SDL_APPACTIVE))) { if (!show) SDL_ShowCursor(SDL_ENABLE); if (grab) SDL_WM_GrabInput(SDL_GRAB_OFF); + return; } if (Mouse.cursor_enabled)