gpointing-device-settings r82 - trunk/src



Author: hiikezoe
Date: Sun Mar  1 23:51:06 2009
New Revision: 82
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=82&view=rev

Log:
barrier bt gdk_error_trap_push() and gdk_error_trap_pop().

Modified:
   trunk/src/gpds-xinput.c

Modified: trunk/src/gpds-xinput.c
==============================================================================
--- trunk/src/gpds-xinput.c	(original)
+++ trunk/src/gpds-xinput.c	Sun Mar  1 23:51:06 2009
@@ -282,10 +282,12 @@
     va_end(copy_var_args);
     g_free(values);
 
+    gdk_error_trap_push();
     XChangeDeviceProperty(GDK_DISPLAY(),
                           device, property_atom,
                           XA_INTEGER, format, PropModeReplace,
                           (unsigned char*)property_data, n_values);
+    gdk_error_trap_pop();
 
     g_free(property_data);
 
@@ -351,6 +353,7 @@
     unsigned char *data, *data_position;
     gulong i;
     gint *int_values;
+    Status status;
 
     g_return_val_if_fail(GPDS_IS_XINPUT(xinput), FALSE);
 
@@ -362,12 +365,14 @@
     if (atom < 0)
         return FALSE;
 
+    gdk_error_trap_push();
+    status =  XGetDeviceProperty(GDK_DISPLAY(), device, atom, 0, 1000, False,
+                                 XA_INTEGER, &actual_type, &actual_format,
+                                 n_values, &bytes_after, &data);
+    gdk_error_trap_pop();
 
-    if (XGetDeviceProperty(GDK_DISPLAY(), device, atom, 0, 1000, False,
-                           XA_INTEGER, &actual_type, &actual_format,
-                           n_values, &bytes_after, &data) != Success) {
+    if (status != Success)
         return FALSE;
-    }
 
     if (actual_type != XA_INTEGER) {
         XFree(data);



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