Fix 'mono' package typo
[mono.git] / bockbuild / mac-sdk / patches / gtk / nsview-embedding-fix-keyboard-routing.patch
1 commit 291c4626867885c74aa3a544eb9f74cd974895a0
2 Author: Cody Russell <cody@jhu.edu>
3 Date:   Wed Jan 14 14:56:34 2015 -0600
4
5     When determining if the event is destined for an NSView outside our
6     view hierarchy, we can't just check if it's not a gtkview, we need to
7     also ensure that none of its superviews are gtkviews.
8
9 diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c
10 index 31c5d33..183537f 100644
11 --- a/gdk/quartz/gdkevents-quartz.c
12 +++ b/gdk/quartz/gdkevents-quartz.c
13 @@ -1823,7 +1823,18 @@ gdk_event_translate (GdkEvent *event,
14          GdkQuartzWindow *nswindow = ((GdkWindowImplQuartz *)private->impl)->toplevel;
15          GdkQuartzView *nsview = ((GdkWindowImplQuartz *)private->impl)->view;
16
17 -        if (![[nswindow firstResponder] respondsToSelector:@selector(isGtkView)])
18 +        NSView *tmp_view = [nswindow firstResponder];
19 +        gboolean gtk_child = FALSE;
20 +
21 +        while (tmp_view != NULL)
22 +          {
23 +            if (tmp_view && [tmp_view respondsToSelector:@selector(isGtkView)])
24 +              gtk_child = TRUE;
25 +
26 +            tmp_view = [tmp_view superview];
27 +          }
28 +
29 +        if (!gtk_child && ![[nswindow firstResponder] respondsToSelector:@selector(isGtkView)])
30            {
31              return_val = FALSE;
32              break;