[Spice-commits] 2 commits - gtk/spice-channel-priv.h gtk/spice-channel.c gtk/spice-widget.c

Hans de Goede jwrdegoede at kemper.freedesktop.org
Thu Dec 15 05:24:47 PST 2011


 gtk/spice-channel-priv.h |    1 -
 gtk/spice-channel.c      |    9 +--------
 gtk/spice-widget.c       |   33 +++++++++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 9 deletions(-)

New commits:
commit 611887147c8006c16fbb29c04a0ff0f2ebff2334
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Thu Dec 1 14:32:24 2011 +0100

    spice-channel: cleanup, get rid of wait_interruptible variable
    
    The private wait_interruptible channel variable is not used anywhere,
    except in one test, which is useless since it never gets set.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/gtk/spice-channel-priv.h b/gtk/spice-channel-priv.h
index 83e7e25..8aa0e7c 100644
--- a/gtk/spice-channel-priv.h
+++ b/gtk/spice-channel-priv.h
@@ -93,7 +93,6 @@ struct _SpiceChannelPrivate {
     gboolean                    has_error;
     guint                       connect_delayed_id;
 
-    int                         wait_interruptible;
     struct wait_queue           wait;
     guint8                      *xmit_buffer;
     int                         xmit_buffer_capacity;
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index c9af0ba..7a57630 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -724,14 +724,7 @@ reread:
 
     if (ret == -1) {
         if (cond != 0) {
-            if (c->wait_interruptible) {
-                if (!g_io_wait_interruptible(&c->wait, c->sock, cond)) {
-                    // SPICE_DEBUG("Read blocking interrupted %d", priv->has_error);
-                    return -EAGAIN;
-                }
-            } else {
-                g_io_wait(c->sock, cond);
-            }
+            g_io_wait(c->sock, cond);
             goto reread;
         } else {
             c->has_error = TRUE;
commit e34ebd9da4130147927eeab47ba3c4d0d2010db7
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Wed Dec 14 14:11:12 2011 +0100

    Disable mouse accelleration when grabbing the mouse (in server mode)
    
    Otherwise accel will be applied twice, once by the client and then once
    more by the guest. Unfortunately there seems to be no gdk / gtk API for this
    so this patch uses direct libX11 calls.
    
    Signed-off-by: Hans de Goede <hdegoede at redhat.com>

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index d2d09af..5ed2e10 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -25,6 +25,10 @@
 #include <X11/XKBlib.h>
 #include <gdk/gdkx.h>
 #endif
+#ifdef GDK_WINDOWING_X11
+#include <X11/Xlib.h>
+#include <gdk/gdkx.h>
+#endif
 #ifdef WIN32
 #include <windows.h>
 #include <gdk/gdkwin32.h>
@@ -568,6 +572,21 @@ static GdkGrabStatus do_pointer_grab(SpiceDisplay *display)
 #endif
     gtk_grab_add(GTK_WIDGET(display));
 
+#ifdef GDK_WINDOWING_X11
+    if (status == GDK_GRAB_SUCCESS) {
+        int accel_numerator;
+        int accel_denominator;
+        int threshold;
+        GdkWindow *w = GDK_WINDOW(gtk_widget_get_window(GTK_WIDGET(display)));
+        Display *x_display = GDK_WINDOW_XDISPLAY(w);
+    
+        XGetPointerControl(x_display, &accel_numerator, &accel_denominator,
+                           &threshold);
+        XChangePointerControl(x_display, False, False, accel_numerator,
+                              accel_denominator, threshold);
+    }
+#endif
+
     gdk_cursor_unref(blank);
     return status;
 }
@@ -670,6 +689,20 @@ static void try_mouse_ungrab(SpiceDisplay *display)
 #ifdef WIN32
     ClipCursor(NULL);
 #endif
+#ifdef GDK_WINDOWING_X11
+    {
+        int accel_numerator;
+        int accel_denominator;
+        int threshold;
+        GdkWindow *w = GDK_WINDOW(gtk_widget_get_window(GTK_WIDGET(display)));
+        Display *x_display = GDK_WINDOW_XDISPLAY(w);
+    
+        XGetPointerControl(x_display, &accel_numerator, &accel_denominator,
+                           &threshold);
+        XChangePointerControl(x_display, True, True, accel_numerator,
+                              accel_denominator, threshold);
+    }
+#endif
 
     d->mouse_grab_active = false;
 


More information about the Spice-commits mailing list