summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-07-04 09:02:38 +0200
committerHans de Goede <hdegoede@redhat.com>2012-07-28 11:09:41 +0200
commit99b2144be5f6261705f7d9f5c112a9453bf2839d (patch)
treef97f43d1de03ca0873981f1966129adff1552939
parent1ca0e710f8115e1bc0406a8799de71fb0b3def13 (diff)
spice-widget: release mouse grab on keyboard-grab-inhibit
The purpose of the keyboard-grab-inihbit mechanism is to allow other apps to grab the input while the spice-widget has the focus, mainly when we're going to invoke policykit for usb-redirection, as that the policy-kit agent may want to grab the input. Before this patch we were only inhibitting the keyboard grab, which works fine for vms which are in client mouse mode, but is not enough for vms which are in server mouse mode. This patch also releases the mouse grab on keyboard-grab-inhibit, fixing the policykit dialog not showing (and thus usb redir not working) when running with server mouse mode. Note that this makes the inhibit-keyboard-grab name of the property no longer really cover what it does, but allas it is part of our ABI... Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--gtk/spice-widget.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 02bb089..2bb7b38 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -372,6 +372,7 @@ static void session_inhibit_keyboard_grab_changed(GObject *gobject,
g_object_get(d->session, "inhibit-keyboard-grab",
&d->keyboard_grab_inhibit, NULL);
update_keyboard_grab(display);
+ update_mouse_grab(display);
}
static void spice_display_dispose(GObject *obj)
@@ -844,7 +845,9 @@ static void update_mouse_grab(SpiceDisplay *display)
{
SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
- if (d->mouse_grab_enable && !d->disable_inputs)
+ if (d->mouse_grab_enable &&
+ !d->keyboard_grab_inhibit &&
+ !d->disable_inputs)
try_mouse_grab(display);
else
try_mouse_ungrab(display);