]> Pileus Git - ~andy/gtk/commitdiff
Apply non-click-through policy on unfocused windows even if the app is active
authorRichard Hult <richard@imendio.com>
Sat, 31 Jan 2009 20:25:41 +0000 (21:25 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:15:31 +0000 (10:15 +0200)
gdk/quartz/gdkevents-quartz.c

index 58eeadf219e5fde28f8ea808cdf199490c4a9291..a24ea453697e8979dc5fc671be7d192401bf1609 100644 (file)
@@ -1526,15 +1526,20 @@ gdk_event_translate (GdkEvent *event,
     }
 
   /* We only activate the application on click if it's not already active,
-   * this matches most use cases of native apps (no click-through).
+   * or if it's active but the window isn't focused. This matches most use
+   * cases of native apps (no click-through).
    */
   if ((event_type == NSRightMouseDown ||
        event_type == NSOtherMouseDown ||
-       event_type == NSLeftMouseDown) && ![NSApp isActive])
+       event_type == NSLeftMouseDown))
     {
-      [NSApp activateIgnoringOtherApps:YES];
-      return_val = FALSE;
-      goto done;
+      GdkWindowObject *private = (GdkWindowObject *)window;
+      GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
+
+      if (![NSApp isActive])
+        return FALSE;
+      else if (![impl->toplevel isMainWindow])
+        return FALSE;
     }
 
   current_event_mask = get_event_mask_from_ns_event (nsevent);