summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-06-11 13:14:25 +0000
committerDaniel Boles <dboles.src@gmail.com>2019-06-12 07:37:27 +0100
commite56a9e6ce5acd05677ece04c85ef219555a5f8e5 (patch)
tree385bd8cda01c03bbc37bffe7da657d8fa27a76e0 /gtk
parentb6c9d23b9ad28fce1b3531e30f31366e8ab50019 (diff)
downloadgtk+-e56a9e6ce5acd05677ece04c85ef219555a5f8e5.tar.gz
window: Fix focus wraparound
If tab focus falls off the end, and we have an empty headerbar, we end up with window->focus == NULL. Don't let that happen Close https://gitlab.gnome.org/GNOME/gtk/issues/686#note_529577
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkwindow.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 874b053d57..eb551bf834 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -8625,7 +8625,7 @@ gtk_window_focus (GtkWidget *widget,
if (old_focus_child)
{
if (gtk_widget_child_focus (old_focus_child, direction))
- return TRUE;
+ return TRUE;
}
if (priv->focus_widget)
@@ -8668,7 +8668,9 @@ gtk_window_focus (GtkWidget *widget,
priv->title_box != child &&
gtk_widget_child_focus (priv->title_box, direction))
return TRUE;
-
+ else if (priv->title_box == child &&
+ gtk_widget_child_focus (gtk_bin_get_child (bin), direction))
+ return TRUE;
}
return FALSE;