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
This commit is contained in:
Matthias Clasen 2019-06-11 13:14:25 +00:00
parent 4c65868643
commit 31066a697b

View File

@ -6305,7 +6305,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)
@ -6348,7 +6348,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;