[gtk-vnc] Don't ungrab pointer on leave-notify events



commit 1344b9270e842ebbafe7c293ff64df0579e73add
Author: Daniel P. Berrange <berrange redhat com>
Date:   Tue Sep 17 16:11:43 2013 +0100

    Don't ungrab pointer on leave-notify events
    
    If we ungrab the pointer on leave-notify events, this breaks
    the automatic grabs when a button is pressed in absolute pointer.
    A symptom of this is that if you press to start highlighting text
    in a gedit window in a server, and move the mouse outside the VNC
    widget and release the button, the server will never see the mouse
    up event. We must preserve grabs upon button press so that the
    VNC server always sees the eventual release events.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=664567
    
    Signed-off-by: Daniel P. Berrange <berrange redhat com>

 src/vncdisplay.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/vncdisplay.c b/src/vncdisplay.c
index 5b8da84..e3270bc 100644
--- a/src/vncdisplay.c
+++ b/src/vncdisplay.c
@@ -970,7 +970,10 @@ static gboolean leave_event(GtkWidget *widget, GdkEventCrossing *crossing G_GNUC
     if (priv->grab_keyboard)
         do_keyboard_ungrab(VNC_DISPLAY(widget), FALSE);
 
-    if (priv->grab_pointer)
+    if (priv->local_pointer)
+        do_pointer_hide(VNC_DISPLAY(widget));
+
+    if (priv->grab_pointer && !priv->absolute)
         do_pointer_ungrab(VNC_DISPLAY(widget), FALSE);
 
     return TRUE;


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