summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-05 16:42:13 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-01-05 16:42:13 +0000
commit455204eb1a0880a5e4474acf07d4641f51123a1d (patch)
treebfd45c2e35a33fe1289de48263177e111ff4ee7d /sdl.c
parent6f30fa853b78203c3a03c91470b7d2d12f46955a (diff)
Dynamic handling of guest mice, by Lonnie Mendez.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2290 c046a42c-6fe2-441c-8c8c-71466251a162
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;