[gtk+] Fix a thinko in creating event masks



commit 491cab3f7f4a14a7ac9254a047fb95859730dc66
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Aug 14 00:10:23 2014 -0400

    Fix a thinko in creating event masks
    
    &-ing together all the device event types yields zero,
    which is clearly not the intention here. Use | instead,
    to create the intended mask.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734641

 gdk/x11/gdkdevice-core-x11.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-core-x11.c b/gdk/x11/gdkdevice-core-x11.c
index 2f87c73..30c8f94 100644
--- a/gdk/x11/gdkdevice-core-x11.c
+++ b/gdk/x11/gdkdevice-core-x11.c
@@ -565,36 +565,36 @@ gdk_x11_device_core_window_at_position (GdkDevice       *device,
 
 static void
 gdk_x11_device_core_select_window_events (GdkDevice    *device,
-                                         GdkWindow    *window,
-                                         GdkEventMask  event_mask)
+                                          GdkWindow    *window,
+                                          GdkEventMask  event_mask)
 {
   GdkEventMask filter_mask, window_mask;
   guint xmask = 0;
   gint i;
 
   window_mask = gdk_window_get_events (window);
-  filter_mask = (GDK_POINTER_MOTION_MASK &
-                 GDK_POINTER_MOTION_HINT_MASK &
-                 GDK_BUTTON_MOTION_MASK &
-                 GDK_BUTTON1_MOTION_MASK &
-                 GDK_BUTTON2_MOTION_MASK &
-                 GDK_BUTTON3_MOTION_MASK &
-                 GDK_BUTTON_PRESS_MASK &
-                 GDK_BUTTON_RELEASE_MASK &
-                 GDK_KEY_PRESS_MASK &
-                 GDK_KEY_RELEASE_MASK &
-                 GDK_ENTER_NOTIFY_MASK &
-                 GDK_LEAVE_NOTIFY_MASK &
-                 GDK_FOCUS_CHANGE_MASK &
-                 GDK_PROXIMITY_IN_MASK &
-                 GDK_PROXIMITY_OUT_MASK &
-                 GDK_SCROLL_MASK);
+  filter_mask = GDK_POINTER_MOTION_MASK
+                | GDK_POINTER_MOTION_HINT_MASK
+                | GDK_BUTTON_MOTION_MASK
+                | GDK_BUTTON1_MOTION_MASK
+                | GDK_BUTTON2_MOTION_MASK
+                | GDK_BUTTON3_MOTION_MASK
+                | GDK_BUTTON_PRESS_MASK
+                | GDK_BUTTON_RELEASE_MASK
+                | GDK_KEY_PRESS_MASK
+                | GDK_KEY_RELEASE_MASK
+                | GDK_ENTER_NOTIFY_MASK
+                | GDK_LEAVE_NOTIFY_MASK
+                | GDK_FOCUS_CHANGE_MASK
+                | GDK_PROXIMITY_IN_MASK
+                | GDK_PROXIMITY_OUT_MASK
+                | GDK_SCROLL_MASK;
 
   /* Filter out non-device events */
   event_mask &= filter_mask;
 
   /* Unset device events on window mask */
-  window_mask &= ~(filter_mask);
+  window_mask &= ~filter_mask;
 
   /* Combine masks */
   event_mask |= window_mask;


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