GtkHeaderBar with no focusable widgets still adds an 'empty' focus entry to its Window's focus chain
Submitted by Daniel Boles
Simply adding a
GtkHeaderBar to a
gtk_window_set_titlebar() introduces an invisible, unusable, useless element into the window's focus chain, which is cycled through by pressing Tab and results in the
Window's focussed widget being
NULL. This should not occur.
If the user packs a Widget into the HB and sets
:can-focus on that, then the 'dummy' focus element seems not to arise. The problem only occurs when there are no focusable widgets in the HB (including packed widgets with
This only seems to be caused by using a
HeaderBar containing no focusable widgets as the
:titlebar of the window. It does not seem to depend on whether the HB is set to show close buttons or has any unfocusable widgets packed into it. I can't think of anything else to test but would welcome ideas.
Demo this by compiling and running the attached sample. Pressing Tab to change the focussed widget will alternate between the
GtkButton within the
Window and a 'dummy' focus option that does nothing except consume Tab and other keypresses. This should not occur, and the focus should remain on the
Button, as it would if the
GtkWindow had a non-CSD titlebar.
Attachment 337790, "test case":