From 063bd57873155ef95d63d74340c53d18fbe2790f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 25 Apr 2014 22:07:13 -0400 Subject: [PATCH] GtkWindow: Avoid a critical in F10 handling The focus widget might be NULL, and we were forgetting to take that possibility into account in one place. --- gtk/gtkwindow.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index b6f6997f34..bd060c3a1f 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -11618,9 +11618,12 @@ gtk_window_activate_menubar (GtkWindow *window, GList *tmp_menubars; GList *menubars; GtkMenuShell *menu_shell; + GtkWidget *focus; + + focus = gtk_window_get_focus (window); if (priv->title_box != NULL && - !gtk_widget_is_ancestor (gtk_window_get_focus (window), priv->title_box) && + (focus == NULL || !gtk_widget_is_ancestor (focus, priv->title_box)) && gtk_widget_child_focus (priv->title_box, GTK_DIR_TAB_FORWARD)) return TRUE;