qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] sdl hide pointer when not in focus


From: Stefano Stabellini
Subject: [Qemu-devel] [PATCH] sdl hide pointer when not in focus
Date: Wed, 05 Nov 2008 11:55:33 +0000
User-agent: Thunderbird 2.0.0.14 (X11/20080505)

Hide the mouse pointer when the sdl window is not in focus and the mouse
is in absolute mode.

Signed-off-by: Stefano Stabellini <address@hidden>

---

diff -r 5c78dd111aae sdl.c
--- a/sdl.c     Tue Nov 04 09:04:41 2008 +0000
+++ b/sdl.c     Wed Nov 05 11:47:07 2008 +0000
@@ -520,6 +520,12 @@
                 !ev->active.gain && !gui_fullscreen_initial_grab) {
                 sdl_grab_end();
             }
+            /* Send mouse pointer to oblivion on focus change */
+            if ((ev->active.state == SDL_APPINPUTFOCUS) ||
+                (ev->active.state == SDL_APPMOUSEFOCUS)) {
+                if (ev->active.gain != SDL_ENABLE && kbd_mouse_is_absolute())
+                    kbd_mouse_event(0x7FFF, 0x7FFF, 0, 0);
+            }
             if (ev->active.state & SDL_APPACTIVE) {
                 if (ev->active.gain) {
                     /* Back to default interval */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]