[gtk+] GtkWindow: Avoid a critical in F10 handling



commit 063bd57873155ef95d63d74340c53d18fbe2790f
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Apr 25 22:07:13 2014 -0400

    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 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index b6f6997..bd060c3 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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]