[gnome-settings-daemon/gnome-3-0] Don't pass NULL to device_is_touchpad



commit 09902ed0c30137fd07de3f33d1418dbf8f959af6
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon May 2 14:52:16 2011 -0400

    Don't pass NULL to device_is_touchpad
    
    It can't handle it...
    https://bugzilla.gnome.org/show_bug.cgi?id=649214

 plugins/mouse/gsd-mouse-manager.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index f39f6b7..869a6de 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -406,14 +406,14 @@ set_motion (GsdMouseManager *manager,
         guint i;
 
         xdevice = open_gdk_device (device);
+        if (xdevice == NULL)
+                return;
+
         if (device_is_touchpad (xdevice))
                 settings = manager->priv->touchpad_settings;
         else
                 settings = manager->priv->mouse_settings;
 
-        if (xdevice == NULL)
-                return;
-
         /* Calculate acceleration */
         motion_acceleration = g_settings_get_double (settings, KEY_MOTION_ACCELERATION);
 
@@ -576,6 +576,8 @@ set_tap_to_click (GdkDevice *device,
                 return;
 
         xdevice = open_gdk_device (device);
+        if (xdevice == NULL)
+                return;
 
         if (!device_is_touchpad (xdevice)) {
                 XCloseDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice);
@@ -622,6 +624,8 @@ set_horiz_scroll (GdkDevice *device,
                 return;
 
         xdevice = open_gdk_device (device);
+        if (xdevice == NULL)
+                return;
 
         if (!device_is_touchpad (xdevice)) {
                 XCloseDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice);
@@ -680,6 +684,8 @@ set_edge_scroll (GdkDevice               *device,
                 return;
 
         xdevice = open_gdk_device (device);
+        if (xdevice == NULL)
+                return;
 
         if (!device_is_touchpad (xdevice)) {
                 XCloseDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice);
@@ -734,6 +740,8 @@ set_touchpad_enabled (GdkDevice *device,
                 return;
 
         xdevice = open_gdk_device (device);
+        if (xdevice == NULL)
+                return;
 
         if (!device_is_touchpad (xdevice)) {
                 XCloseDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xdevice);



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