mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-03 17:21:11 +00:00
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:
parent
235837ad49
commit
fb8791cd16
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user