[gnome-settings-daemon] wacom: Clean up last tool filter setup



commit da080b94bc2af338aa17090aa0b92a60352cab7e
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Feb 20 14:00:17 2012 +0100

    wacom: Clean up last tool filter setup

 plugins/wacom/gsd-wacom-device.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index d471e1c..73def1c 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -387,18 +387,18 @@ setup_property_notify (GsdWacomDevice *device)
 {
 	Display *dpy;
 	XIEventMask evmask;
-	unsigned char bitmask[2] = { 0 };
 	int tool_id;
 
-	XISetMask (bitmask, XI_PropertyEvent);
-
 	evmask.deviceid = device->priv->device_id;
-	evmask.mask_len = sizeof (bitmask);
-	evmask.mask = bitmask;
+	evmask.mask_len = XIMaskLen (XI_PropertyEvent);
+	evmask.mask = g_malloc0(evmask.mask_len * sizeof(char));
+	XISetMask (evmask.mask, XI_PropertyEvent);
 
 	dpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
 	XISelectEvents (dpy, DefaultRootWindow(dpy), &evmask, 1);
 
+	g_free (evmask.mask);
+
 	gdk_window_add_filter (NULL,
 			       (GdkFilterFunc) filter_events,
 			       device);



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