[gnome-settings-daemon/gnome-3-4] common: Try XI 2.2 if XI 2.0 fails



commit 9d23fac4ce927cd27964323aa4cf8138e5128ba0
Author: Peter Hutterer <peter hutterer who-t net>
Date:   Thu Apr 12 13:51:09 2012 +1000

    common: Try XI 2.2 if XI 2.0 fails
    
    The media-keys plugin calls supports_xinput2_devices(). That again calls
    XIQueryDevice with a major/minor of 2.0. The upstream server has a check
    for this in place and responds BadValue if a client initiates XI2 twice
    with two different versions (such both us and GTK+ checking for
    different versions). This happens here, and thus the plugin fails
    to load.
    
    The X server was fixed, but this is still required for older versions
    of the Xi code:
    http://cgit.freedesktop.org/xorg/xserver/commit/?id=ea51e9b2877df60135edaf2a8f88d0f2a2b41060
    
    https://bugzilla.gnome.org/show_bug.cgi?id=673964

 plugins/common/gsd-input-helper.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/plugins/common/gsd-input-helper.c b/plugins/common/gsd-input-helper.c
index cf9e83d..f06b507 100644
--- a/plugins/common/gsd-input-helper.c
+++ b/plugins/common/gsd-input-helper.c
@@ -129,7 +129,14 @@ supports_xinput2_devices (int *opcode)
 
         if (XIQueryVersion (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &major, &minor) != Success) {
                 gdk_error_trap_pop_ignored ();
-                return FALSE;
+                /* try for 2.2, maybe gtk has already announced 2.2 support */
+                gdk_error_trap_push ();
+                major = 2;
+                minor = 2;
+                if (XIQueryVersion (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &major, &minor) != Success) {
+                    gdk_error_trap_pop_ignored ();
+                    return FALSE;
+                }
         }
         gdk_error_trap_pop_ignored ();
 



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