From 730a44a51694bb5933ae395ea3631d815a9f8a9c Mon Sep 17 00:00:00 2001 From: Richard Hult Date: Fri, 20 Feb 2009 15:36:15 +0100 Subject: [PATCH] Tweak the click-through handling so active apps get it (but not inactive ones) --- gdk/quartz/gdkevents-quartz.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index 5b93ad5179..db73a11c32 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -1040,9 +1040,10 @@ gdk_event_translate (GdkEvent *event, } } - /* 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 the app 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 the app is active, we focus the window and then handle + * the event, also to match native apps. */ if ((event_type == NSRightMouseDown || event_type == NSOtherMouseDown || @@ -1057,7 +1058,13 @@ gdk_event_translate (GdkEvent *event, return FALSE; } else if (![impl->toplevel isKeyWindow]) - return FALSE; + { + GdkPointerGrabInfo *grab; + + grab = _gdk_display_get_last_pointer_grab (_gdk_display); + if (!grab) + [impl->toplevel makeKeyWindow]; + } } current_event_mask = get_event_mask_from_ns_event (nsevent);