]> Pileus Git - ~andy/gtk/commitdiff
quartz: always send GDK_NOTIFY_NONLINEAR crossing events
authorMichael Natterer <mitch@gimp.org>
Fri, 9 Nov 2012 16:12:30 +0000 (17:12 +0100)
committerMichael Natterer <mitch@gimp.org>
Tue, 20 Nov 2012 09:35:40 +0000 (10:35 +0100)
so GtkMenu works properly. This is not right, but not more
wrong than always sending GDK_NOTIFY_ANCESTOR either.
(cherry picked from commit 35a9322e45bb403d34c9e4da036d9d8d559419fb)

gdk/quartz/gdkevents-quartz.c

index cd05882a050af4a35a5a7c5d9552d42f5b8daf3f..fcda0724414138bd54a38db72ed3bffa28e8c091 100644 (file)
@@ -1121,8 +1121,9 @@ synthesize_crossing_event (GdkWindow *window,
   switch ([nsevent type])
     {
     case NSMouseEntered:
-      /* Enter events are considered always to be from the root window as we
-       * can't know for sure from what window we enter.
+      /* Enter events are considered always to be from another toplevel
+       * window, this shouldn't negatively affect any app or gtk code,
+       * and is the only way to make GtkMenu work. EEK EEK EEK.
        */
       if (!(window->event_mask & GDK_ENTER_NOTIFY_MASK))
         return FALSE;
@@ -1132,14 +1133,11 @@ synthesize_crossing_event (GdkWindow *window,
                            x_root, y_root,
                            GDK_ENTER_NOTIFY,
                            GDK_CROSSING_NORMAL,
-                           GDK_NOTIFY_ANCESTOR);
+                           GDK_NOTIFY_NONLINEAR);
       return TRUE;
 
     case NSMouseExited:
-      /* Exited always is to the root window as far as we are concerned,
-       * since there is no way to reliably get information about what new
-       * window is entered when exiting one.
-       */
+      /* See above */
       if (!(window->event_mask & GDK_LEAVE_NOTIFY_MASK))
         return FALSE;
 
@@ -1148,7 +1146,7 @@ synthesize_crossing_event (GdkWindow *window,
                            x_root, y_root,
                            GDK_LEAVE_NOTIFY,
                            GDK_CROSSING_NORMAL,
-                           GDK_NOTIFY_ANCESTOR);
+                           GDK_NOTIFY_NONLINEAR);
       return TRUE;
 
     default: