[gnome-settings-daemon] mouse: wrap device button mapping into gdk_error_trap_push/pop



commit 7a07cd12b862fa40ab5c38fee3dc264bb483a494
Author: Peter Hutterer <peter hutterer who-t net>
Date:   Thu Feb 20 17:19:02 2014 +1000

    mouse: wrap device button mapping into gdk_error_trap_push/pop
    
    The device may have disappeared by the time we get here, so make sure we catch
    BadDevice errors as well by moving the error trap push up before the first X
    call.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724789

 plugins/mouse/gsd-mouse-manager.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index f033de1..f7c6432 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -348,6 +348,8 @@ set_left_handed (GsdMouseManager *manager,
                 left_handed = mouse_left_handed;
         }
 
+        gdk_error_trap_push ();
+
         n_buttons = XGetDeviceButtonMapping (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice,
                                              buttons,
                                              buttons_capacity);
@@ -364,7 +366,6 @@ set_left_handed (GsdMouseManager *manager,
 
         configure_button_layout (buttons, n_buttons, left_handed);
 
-       gdk_error_trap_push ();
         XSetDeviceButtonMapping (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice, buttons, 
n_buttons);
         gdk_error_trap_pop_ignored ();
 


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