[gtk+/gtk-2-18] Don't filter out BUTTON_MOTION event masks



commit 4a92edd10a33b3826959263b0726fb402dd07ef2
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Dec 2 11:09:37 2009 +0100

    Don't filter out BUTTON_MOTION event masks
    
    We don't really need to filter these out, it was just a leftover
    safety check to not override the GDK_POINTER_MOTION_MASK.
    
    Furthermore when we changed behaviour to not always select for native
    pointer motion it is actually wrong. We'll still get normal motion
    events for the toplevel which we will emulate as button motion on the
    child, but the button motion mask will not be inherited by implicit
    grabs which makes us not get any motion events during grabs.
    
    This fixes bug 601473
    (cherry picked from commit b509f28559dba03684ecc88acac498b6f27d2ebf)

 gdk/gdkwindow.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 66bfe44..f5f9ca6 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1181,14 +1181,12 @@ get_native_event_mask (GdkWindowObject *private)
 
       /* Do whatever the app asks to, since the app
        * may be asking for weird things for native windows,
-       * but filter out things that override the special
-       * requests below. */
-      mask = private->event_mask &
-	~(GDK_POINTER_MOTION_HINT_MASK |
-	  GDK_BUTTON_MOTION_MASK |
-	  GDK_BUTTON1_MOTION_MASK |
-	  GDK_BUTTON2_MOTION_MASK |
-	  GDK_BUTTON3_MOTION_MASK);
+       * but don't use motion hints as that may affect non-native
+       * child windows that don't want it. Also, we need to
+       * set all the app-specified masks since they will be picked
+       * up by any implicit grabs (i.e. if they were not set as
+       * native we would not get the events we need). */
+      mask = private->event_mask & ~GDK_POINTER_MOTION_HINT_MASK;
 
       /* We need thse for all native windows so we can
 	 emulate events on children: */
@@ -1228,11 +1226,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
     GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
     GDK_SCROLL_MASK |
     (grab_mask &
-     ~(GDK_POINTER_MOTION_HINT_MASK |
-       GDK_BUTTON_MOTION_MASK |
-       GDK_BUTTON1_MOTION_MASK |
-       GDK_BUTTON2_MOTION_MASK |
-       GDK_BUTTON3_MOTION_MASK));
+     ~GDK_POINTER_MOTION_HINT_MASK);
 }
 
 /* Puts the native window in the right order wrt the other native windows



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