summaryrefslogtreecommitdiff
path: root/video/sdl_v.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/sdl_v.c')
-rw-r--r--video/sdl_v.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/video/sdl_v.c b/video/sdl_v.c
index 3b27c7ad6..d190237fb 100644
--- a/video/sdl_v.c
+++ b/video/sdl_v.c
@@ -345,6 +345,15 @@ static int PollEvent(void)
}
break;
+ case SDL_ACTIVEEVENT:
+ if (ev.active.gain == 1) // mouse entered the window, enable cursor
+ _cursor.in_window = true;
+ else if (ev.active.gain == 0) {
+ UndrawMouseCursor(); // mouse left the window, undraw cursor
+ _cursor.in_window = false;
+ }
+ break;
+
case SDL_QUIT:
// do not ask to quit on the main screen
if (_game_mode != GM_MENU) {