[Spice-commits] 3 commits - gtk/channel-display.c gtk/channel-usbredir.c gtk/spice-widget.c

Hans de Goede jwrdegoede at kemper.freedesktop.org
Fri Aug 3 07:00:39 PDT 2012


 gtk/channel-display.c  |    1 +
 gtk/channel-usbredir.c |    9 +++++++--
 gtk/spice-widget.c     |    5 ++++-
 3 files changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 88a1eff2f24eeb82e7c20b3dc46e01bc61554ef2
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Sat Jul 28 11:37:37 2012 +0200

    Remove "usbredirhost: " prefix from usbredirhost error messages
    
    libusbredirhost prefixes all its messages with "usbredirhhost: ", which
    is useful when logging to stderr, but not so much when showing the error
    to the user in an error dialog, so remove the "usbredirhost: " prefix
    when we store the message in a GError.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/gtk/channel-usbredir.c b/gtk/channel-usbredir.c
index 354d2e1..e7e5629 100644
--- a/gtk/channel-usbredir.c
+++ b/gtk/channel-usbredir.c
@@ -448,8 +448,13 @@ static void usbredir_log(void *user_data, int level, const char *msg)
 
     if (priv->catch_error && level == usbredirparser_error) {
         SPICE_DEBUG("%s", msg);
-        g_set_error_literal(priv->catch_error, SPICE_CLIENT_ERROR,
-                            SPICE_CLIENT_ERROR_FAILED, msg);
+        /* Remove "usbredirhost: " prefix from usbredirhost messages */
+        if (strncmp(msg, "usbredirhost: ", 14) == 0)
+            g_set_error_literal(priv->catch_error, SPICE_CLIENT_ERROR,
+                                SPICE_CLIENT_ERROR_FAILED, msg + 14);
+        else
+            g_set_error_literal(priv->catch_error, SPICE_CLIENT_ERROR,
+                                SPICE_CLIENT_ERROR_FAILED, msg);
         return;
     }
 
commit 498cc2677dc75a9d868c748bea08a07f82ce9d3d
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Sat Jul 28 11:06:49 2012 +0200

    channel-display: Set monitors_max to 1 on init
    
    This fixes remote-viewer with the new multi monitor support not working
    when connecting to a spice-server without the new multi-monitor support.
    
    Before this fix remote-viewer would hit the following g_return_if_fail:
    (remote-viewer:24787): remote-viewer-CRITICAL **:
     virt_viewer_session_spice_display_monitors:
      assertion `monitors->len <= monitors_max' failed
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index 72d2c12..4ed3bbb 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -696,6 +696,7 @@ static void spice_display_channel_init(SpiceDisplayChannel *channel)
 #if defined(WIN32)
     c->dc = create_compatible_dc();
 #endif
+    c->monitors_max = 1;
     spice_display_channel_reset_capabilities(SPICE_CHANNEL(channel));
 }
 
commit 99b2144be5f6261705f7d9f5c112a9453bf2839d
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Jul 4 09:02:38 2012 +0200

    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 at redhat.com>

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);


More information about the Spice-commits mailing list