Skip to contentSkip to conversation

Fix SDL mouse invisible wall

PATCH In review Donald D. Dugger 2 participants 2 messages Jun 14, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix SDL mouse invisible wall

Thanks to Anthony Liquori off the QEMU mailing list for this SDL mouse fix. The new mouse code can hit situation where it won't move past invisible wall on the screen. This patch fixes that problem.

Signature · 30 lines
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
[email protected]
Ph: (303)440-1368



diff -r 6bffed2aa78b tools/ioemu/sdl.c
--- a/tools/ioemu/sdl.c	Mon Jun 12 17:56:20 2006 +0100
+++ b/tools/ioemu/sdl.c	Wed Jun 14 10:10:36 2006 -0600
@@ -376,13 +376,18 @@ static void sdl_update_caption(void)
 
 static void sdl_hide_cursor(void)
 {
-    SDL_SetCursor(sdl_cursor_hidden);
+    if (kbd_mouse_is_absolute()) {
+	SDL_ShowCursor(1);
+	SDL_SetCursor(sdl_cursor_hidden);
+    } else {
+	SDL_ShowCursor(0);
+    }
 }
 
 static void sdl_show_cursor(void)
 {
     if (!kbd_mouse_is_absolute()) {
-	SDL_SetCursor(sdl_cursor_normal);
+	SDL_ShowCursor(1);
     }
 }
#1 lore raw

It's rather curious as to whether this one needs my Signed-off-by since this is my patch verbatim :-)

Just in case, Signed-off-by: Anthony Liguori <[email protected]> :-)

Regards,

Anthony Liguori

Quoted 8 lines · Donald D. Dugger

Thanks to Anthony Liquori off the QEMU mailing list for this SDL mouse fix. The new mouse code can hit situation where it won't move past invisible wall on the screen. This patch fixes that problem.