From fe3c410048a6b069efd63a2007d5a14606d0aa4a Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 3 Feb 2009 22:51:27 +0100 Subject: [PATCH] Filter out all native grab/ungrab events with detail INFERIOR These are generated when we get an implicit grab on a native child window, and we can't filter them with _has_grab() because they are sent before the button press event where we detect the implicit grab. This makes clicks work in the flash plugin again --- gdk/gdkwindow.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index dfa12141b7..aa96c072fd 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -8651,12 +8651,25 @@ _gdk_windowing_got_event (GdkDisplay *display, event->type == GDK_LEAVE_NOTIFY) && (event->crossing.mode == GDK_CROSSING_GRAB || event->crossing.mode == GDK_CROSSING_UNGRAB) && - _gdk_display_has_pointer_grab (display, serial)) + (_gdk_display_has_pointer_grab (display, serial) || + event->crossing.detail == GDK_NOTIFY_INFERIOR)) { /* We synthesize all crossing events due to grabs outselves, - * so we ignore the native ones when we already have a grab. - * Otherwise we would send multiple events when this app grabs - * We want to handle grabs from other clients though. */ + * so we ignore the native ones caused by our native pointer_grab + * calls. Otherwise we would proxy these crossing event and cause + * multiple copies of crossing events for grabs. + * + * We do want to handle grabs from other clients though, as for + * instance alt-tab in metacity causes grabs like these and + * we want to handle those. Thus the has_pointer_grab check. + * + * Implicit grabs on child windows create some grabbing events + * that are sent before the button press. This means we can't + * detect these with the has_pointer_grab check (as the implicit + * grab is only noticed when we get button press event), so we + * detect these events by checking for INFERIOR enter or leave + * events. These should never be a problem to filter out. + */ /* We ended up in this window after some (perhaps other clients) grab, so update the toplevel_under_window state */