diff --git a/video/sdl_v.c b/video/sdl_v.c index d190237fb2..a90333ae4f 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; }