From 4f5d6ea605562290ac25cff256caf2dec5c16fd2 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 9bf93b486..d8ee24e28 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ D1X-Rebirth Changelog 20100727 -------- 2d/pcx.c, include/pcx.h, main/cntrlcen.h, main/effects.c, main/fireball.c, main/fuelcen.h, main/gameseq.c, main/kmatrix.c, main/net_ipx.c, main/net_udp.c, main/render.c, main/segment.h, main/switch.c: Show main menu background for died in mine messagebox; 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)