Don't ignore all events when inactive, only clicks

This commit is contained in:
Richard Hult 2009-02-03 18:47:09 +01:00 committed by Alexander Larsson
parent 41d40786b1
commit 6d1a8853c4

View File

@ -889,12 +889,6 @@ gdk_event_translate (GdkEvent *event,
int x_root, y_root; int x_root, y_root;
gboolean return_val; 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 /* There is no support for real desktop wide grabs, so we break
* grabs when the application loses focus (gets deactivated). * 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, /* If the app is not active, or the window (when not grabbed) is not
* or if it's active but the window isn't focused. This matches most use * active, leave the event to AppKit so the window gets focused correctly
* cases of native apps (no click-through). * and don't do click-through (so we behave like most native apps).
*/ */
if ((event_type == NSRightMouseDown || if ((event_type == NSRightMouseDown ||
event_type == NSOtherMouseDown || event_type == NSOtherMouseDown ||
@ -1002,7 +996,10 @@ gdk_event_translate (GdkEvent *event,
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl); GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
if (![NSApp isActive]) if (![NSApp isActive])
return FALSE; {
[NSApp activateIgnoringOtherApps:YES];
return FALSE;
}
else if (![impl->toplevel isKeyWindow]) else if (![impl->toplevel isKeyWindow])
return FALSE; return FALSE;
} }