[gtk+] window: fallback to window muxer if no widget has focus



commit fb8791cd16bf604641e204f009fc258dd8ecc7b5
Author: Christian Hergert <christian hergert me>
Date:   Mon Dec 8 20:19:23 2014 -0800

    window: fallback to window muxer if no widget has focus
    
    This ensures that we can still match accelerators for the window even
    if no widget currently has focus.

 gtk/gtkwindow.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 842a5ff..8394fc4 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -11214,10 +11214,16 @@ gtk_window_activate_key (GtkWindow   *window,
 
               if (window->priv->application)
                 {
-                  GtkWidget *focused_widget = gtk_window_get_focus (window);
-                  if (focused_widget == NULL)
-                    return FALSE;
-                  GtkActionMuxer *muxer = _gtk_widget_get_action_muxer (focused_widget, FALSE);
+                  GtkWidget *focused_widget;
+                  GtkActionMuxer *muxer;
+
+                  focused_widget = gtk_window_get_focus (window);
+
+                  if (focused_widget)
+                    muxer = _gtk_widget_get_action_muxer (focused_widget, FALSE);
+                  else
+                    muxer = _gtk_widget_get_action_muxer (GTK_WIDGET (window), FALSE);
+
                   if (muxer == NULL)
                     return FALSE;
 


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