summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-03-24 17:00:55 +0000
committerDarkvater <darkvater@openttd.org>2006-03-24 17:00:55 +0000
commit58722eb14524d7eb84c055d8443bee3da3962503 (patch)
tree372d0be6a0da64208032f0c38a2228caf61c418c
parenta89cea072c81289524e0001f61207d42ed2739de (diff)
downloadopenttd-58722eb14524d7eb84c055d8443bee3da3962503.tar.xz
(svn r4090) - Followup for r4075. Some SDL implementations seem to have a different define for the SDL_ACTIVEEVENT SDL_APPMOUSEFOCUS which caused undrawing of the mouse only on losing input-focus. Correctly check for the event state
-rw-r--r--video/sdl_v.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/video/sdl_v.c b/video/sdl_v.c
index d190237fb..a90333ae4 100644
--- a/video/sdl_v.c
+++ b/video/sdl_v.c
@@ -346,9 +346,11 @@ static int PollEvent(void)
break;
case SDL_ACTIVEEVENT:
- if (ev.active.gain == 1) // mouse entered the window, enable cursor
+ if (!(ev.active.state & SDL_APPMOUSEFOCUS)) break;
+
+ if (ev.active.gain) { // mouse entered the window, enable cursor
_cursor.in_window = true;
- else if (ev.active.gain == 0) {
+ } else {
UndrawMouseCursor(); // mouse left the window, undraw cursor
_cursor.in_window = false;
}