[gtk+/xi2: 854/1239] GdkDeviceManagerXI2: Fix fatal warning.



commit cf0f18e39167db466576916bdc9bf67dcfafbb99
Author: Carlos Garnacho <carlos lanedo com>
Date:   Mon Aug 24 02:30:26 2009 +0200

    GdkDeviceManagerXI2: Fix fatal warning.
    
    Axis labels may contain None, translate these to GDK_NONE.

 gdk/x11/gdkdevicemanager-xi2.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 5f11500..ab429c3 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -149,6 +149,7 @@ translate_valuator_class (GdkDisplay          *display,
   static gboolean initialized = FALSE;
   static Atom label_atoms [GDK_AXIS_LAST] = { 0 };
   GdkAxisUse use = GDK_AXIS_IGNORE;
+  GdkAtom label;
   gint i;
 
   if (!initialized)
@@ -171,8 +172,13 @@ translate_valuator_class (GdkDisplay          *display,
         }
     }
 
+  if (info->label != None)
+    label = gdk_x11_xatom_to_atom_for_display (display, info->label);
+  else
+    label = GDK_NONE;
+
   _gdk_device_add_axis (device,
-                        gdk_x11_xatom_to_atom_for_display (display, info->label),
+                        label,
                         use,
                         info->min,
                         info->max,



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