diff options
author | Andrea Azzarone <azzaronea@gmail.com> | 2018-07-26 10:16:32 +0200 |
---|---|---|
committer | Andrea Azzarone <andrea.azzarone@canonical.com> | 2018-07-30 09:30:26 +0200 |
commit | e1a7629a85151cc616247f0ae8c80b3c512568d8 (patch) | |
tree | e191d96a15e77337f4b32f711790deb2a8e267bf /gtk/gtkwindow.c | |
parent | 7d3b8b0d09b0a11e2d51fcc015bce86b60e4b660 (diff) | |
download | gtk+-e1a7629a85151cc616247f0ae8c80b3c512568d8.tar.gz |
window: Fallback to CSD titlebar in focus-chain
CSD titlebar are included in the focus-chain. The logic used makes sure that the
initial focus avoids the titlebar, but tabbing around will eventually get there.
This logic fails in case the window has no other focusable widgets apart from
the ones in the header-bar. If this happens keynav focus will be lost. To handle
the above scenario, we need to fallback to focus the header-bar (if any).
Fixes: https://gitlab.gnome.org/GNOME/gnome-software/issues/404
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r-- | gtk/gtkwindow.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index be734c1d14..2c5e9feaf2 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -7689,6 +7689,11 @@ gtk_window_focus (GtkWidget *widget, { if (gtk_widget_child_focus (child, direction)) return TRUE; + else if (priv->title_box != NULL && + priv->title_box != child && + gtk_widget_child_focus (priv->title_box, direction)) + return TRUE; + } return FALSE; |