6bdd276d05
Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
commit f35387716481b79c353f098cb80ded665bd7d399
|
|
Author: Cody Russell <cody@jhu.edu>
|
|
Date: Sat Feb 28 11:27:07 2015 -0600
|
|
|
|
GtkNSView should only unset the first responder if either it is
|
|
our embedded view or if our toplevel window is no longer focused.
|
|
|
|
diff --git a/gtk/gtknsview.c b/gtk/gtknsview.c
|
|
index b325bda..645231d 100644
|
|
--- a/gtk/gtknsview.c
|
|
+++ b/gtk/gtknsview.c
|
|
@@ -534,6 +534,7 @@ gtk_ns_view_notify (GObject *object,
|
|
GParamSpec *pspec)
|
|
{
|
|
GtkNSView *ns_view = GTK_NS_VIEW (object);
|
|
+ GtkWindow *window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (object)));
|
|
|
|
if (G_OBJECT_CLASS (gtk_ns_view_parent_class)->notify)
|
|
G_OBJECT_CLASS (gtk_ns_view_parent_class)->notify (object, pspec);
|
|
@@ -550,7 +551,7 @@ gtk_ns_view_notify (GObject *object,
|
|
|
|
if (gtk_widget_has_focus (GTK_WIDGET (object)))
|
|
[ns_window makeFirstResponder:ns_view->priv->view];
|
|
- else
|
|
+ else if ([ns_window firstResponder] == ns_view->priv->view || !gtk_window_is_active (window))
|
|
[ns_window makeFirstResponder:nil];
|
|
}
|
|
}
|