aboutsummaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sdl.c b/sdl.c
index b58e9d679..5ec0f67ef 100644
--- a/sdl.c
+++ b/sdl.c
@@ -319,6 +319,7 @@ static void sdl_show_cursor(void)
{
if (!kbd_mouse_is_absolute()) {
SDL_ShowCursor(1);
+ SDL_SetCursor(sdl_cursor_normal);
}
}
@@ -364,6 +365,9 @@ static void sdl_send_mouse_event(int dz)
SDL_GetMouseState(&dx, &dy);
dx = dx * 0x7FFF / width;
dy = dy * 0x7FFF / height;
+ } else if (absolute_enabled) {
+ sdl_show_cursor();
+ absolute_enabled = 0;
}
kbd_mouse_event(dx, dy, dz, buttons);
@@ -501,7 +505,8 @@ static void sdl_refresh(DisplayState *ds)
}
break;
case SDL_MOUSEMOTION:
- if (gui_grab || kbd_mouse_is_absolute()) {
+ if (gui_grab || kbd_mouse_is_absolute() ||
+ absolute_enabled) {
sdl_send_mouse_event(0);
}
break;