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.
This commit is contained in:
Christian Hergert 2014-12-08 20:19:23 -08:00
parent 235837ad49
commit fb8791cd16

View File

@ -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;