]> Pileus Git - ~andy/gtk/commitdiff
Don't ignore all events when inactive, only clicks
authorRichard Hult <richard@imendio.com>
Tue, 3 Feb 2009 17:47:09 +0000 (18:47 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:15:32 +0000 (10:15 +0200)
gdk/quartz/gdkevents-quartz.c

index 1c3a177185ae5fbc42d8bfc65b2b62ae6228f554..a9f31547933eeddf4e990f048d2bdedbc2f5ec85 100644 (file)
@@ -889,12 +889,6 @@ gdk_event_translate (GdkEvent *event,
   int x_root, y_root;
   gboolean return_val;
 
-  /* Ignore events altogether when we're not active, otherwise we get
-   * tooltips etc for inactive apps.
-   */
-  if (![NSApp isActive])
-    return FALSE;
-
   /* There is no support for real desktop wide grabs, so we break
    * grabs when the application loses focus (gets deactivated).
    */
@@ -990,9 +984,9 @@ gdk_event_translate (GdkEvent *event,
        }
     }
 
-  /* We only activate the application on click if it's not already active,
-   * or if it's active but the window isn't focused. This matches most use
-   * cases of native apps (no click-through).
+  /* If the app is not active, or the window (when not grabbed) is not
+   * active, leave the event to AppKit so the window gets focused correctly
+   * and don't do click-through (so we behave like most native apps).
    */
   if ((event_type == NSRightMouseDown ||
        event_type == NSOtherMouseDown ||
@@ -1002,7 +996,10 @@ gdk_event_translate (GdkEvent *event,
       GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
 
       if (![NSApp isActive])
-        return FALSE;
+        {
+          [NSApp activateIgnoringOtherApps:YES];
+          return FALSE;
+        }
       else if (![impl->toplevel isKeyWindow])
         return FALSE;
     }