[gtk-vnc-devel] PATCH: Avoid breaking ungrab



The 0.3.7 release has a nasty bug where if the server transitions from
relative pointer mode, to absolute pointer mode while the mouse grab is
active, it'll never let you ungrab. Unfortunately this happens during
boot of many VMs.

The change causing this was this:

changeset:   219:e7d57ece8227
user:        Jonh Wendell <wendell bani com br>
date:        Thu May 29 15:51:23 2008 -0300
files:       src/vncdisplay.c
description:
Ignore CTRL-ALT key combination if we are autograbbing and pointer is absolute


The motivation was right, but we need to tweak its handling slightly, so 
that it honours an ungrab request if the grab is currently active. The
attached patch fixes this

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
diff -r cf0e849385e0 src/vncdisplay.c
--- a/src/vncdisplay.c	Thu Sep 11 17:07:42 2008 +0100
+++ b/src/vncdisplay.c	Wed Sep 24 20:56:01 2008 +0100
@@ -703,13 +703,12 @@
 		}
 	}
 
-	if ((!priv->grab_keyboard || !priv->absolute) &&
-	    key->type == GDK_KEY_PRESS &&
+	if (key->type == GDK_KEY_PRESS &&
 	    ((keyval == GDK_Control_L && (key->state & GDK_MOD1_MASK)) ||
 	     (keyval == GDK_Alt_L && (key->state & GDK_CONTROL_MASK)))) {
 		if (priv->in_pointer_grab)
 			do_pointer_ungrab(VNC_DISPLAY(widget), FALSE);
-		else
+		else if (!priv->grab_keyboard || !absolute)
 			do_pointer_grab(VNC_DISPLAY(widget), FALSE);
 	}
 


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