Apply non-click-through policy on unfocused windows even if the app is active

This commit is contained in:
Richard Hult 2009-01-31 21:25:41 +01:00 committed by Alexander Larsson
parent c36625879b
commit e8d6ac71b7

View File

@ -1526,15 +1526,20 @@ gdk_event_translate (GdkEvent *event,
} }
/* We only activate the application on click if it's not already active, /* 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 || if ((event_type == NSRightMouseDown ||
event_type == NSOtherMouseDown || event_type == NSOtherMouseDown ||
event_type == NSLeftMouseDown) && ![NSApp isActive]) event_type == NSLeftMouseDown))
{ {
[NSApp activateIgnoringOtherApps:YES]; GdkWindowObject *private = (GdkWindowObject *)window;
return_val = FALSE; GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
goto done;
if (![NSApp isActive])
return FALSE;
else if (![impl->toplevel isMainWindow])
return FALSE;
} }
current_event_mask = get_event_mask_from_ns_event (nsevent); current_event_mask = get_event_mask_from_ns_event (nsevent);