1 From 6bf17cdaffe648ce53dd39619c3ff9a65d272831 Mon Sep 17 00:00:00 2001
2 From: Michael Natterer <mitch@gimp.org>
3 Date: Fri, 5 Jul 2013 11:49:22 +0200
4 Subject: [PATCH 52/68] nsview: also focus the GtkNSView if a focussable
8 gtk/gtknsview.c | 22 +++++++++++++++-------
9 1 file changed, 15 insertions(+), 7 deletions(-)
11 diff --git a/gtk/gtknsview.c b/gtk/gtknsview.c
12 index b37b2fa..3b30d3b 100644
15 @@ -713,17 +713,25 @@ gtk_ns_view_native_child_event (GdkWindow *window,
18 if (! gtk_widget_has_focus (GTK_WIDGET (ns_view)) &&
20 - /* other code can set can-focus, so check for both */
21 - gtk_widget_get_can_focus (GTK_WIDGET (ns_view)) &&
22 - [ns_view->priv->view acceptsFirstResponder])
23 + gtk_widget_get_can_focus (GTK_WIDGET (ns_view)))
25 + NSPoint point = [[view superview ] convertPoint: [event locationInWindow]
27 + NSView *hit = [view hitTest: point];
31 + [hit ancestorSharedWithView: view] == view) &&
32 + ([hit acceptsFirstResponder] ||
33 + [view acceptsFirstResponder]))
36 - g_printerr ("grabbing focus on %s\n",
37 - class_getName ([ns_view->priv->view class]));
38 + g_printerr ("grabbing focus on %s\n",
39 + class_getName ([ns_view->priv->view class]));
42 - gtk_widget_grab_focus (GTK_WIDGET (ns_view));
43 + gtk_widget_grab_focus (GTK_WIDGET (ns_view));
49 1.7.10.2 (Apple Git-33)