[Spice-commits] gtk/spice-widget.c

Marc-André Lureau elmarco at kemper.freedesktop.org
Tue Apr 10 10:10:23 PDT 2012


 gtk/spice-widget.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 9e1273fe1fdd42773027cd385f2d50bacb59a719
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Tue Apr 10 13:20:48 2012 +0200

    Fix cursor hide not hiding in some cases
    
    cursor_set() didn't un-hide correctly by setting "show_cursor" to
    NULL.
    
    The code is simplified a bit in server mode case, where the new cursor
    will be invalidated and shown during cursor move only, instead of
    twice (checked no regression with dual-head server mode)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index ff361bf..30e58dc 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1645,17 +1645,21 @@ static void cursor_set(SpiceCursorChannel *channel,
     } else
         g_warn_if_reached();
 
-    if (d->show_cursor && d->mouse_mode == SPICE_MOUSE_MODE_SERVER) {
-        /* keep hidden cursor, will be shown in cursor_move() */
+    if (d->show_cursor) {
+        /* unhide */
         gdk_cursor_unref(d->show_cursor);
-        d->show_cursor = cursor;
-    } else {
-        gdk_cursor_unref(d->mouse_cursor);
-        d->mouse_cursor = cursor;
+        d->show_cursor = NULL;
+        if (d->mouse_mode == SPICE_MOUSE_MODE_SERVER) {
+            /* keep a hidden cursor, will be shown in cursor_move() */
+            d->show_cursor = cursor;
+            return;
+        }
     }
 
-    update_mouse_pointer(display);
+    gdk_cursor_unref(d->mouse_cursor);
+    d->mouse_cursor = cursor;
 
+    update_mouse_pointer(display);
     cursor_invalidate(display);
 }
 


More information about the Spice-commits mailing list