GtkEventControllerKey::contains-focus should work differently
contains-focus
IMO should be set when focus is either in the widget itself or in one of its children, not just when it is in one of the children. This is the common use case, so it should be the most trivial option.
Let me illustrate:
use | focus position | current | proposed |
---|---|---|---|
common | in widget or child | is || contains | contains |
common | in widget, not in child | is | is |
rare | in child | contains | contains && !is |
rare | outside of widget and child | !is && !contains | !contains |
I believe one of the two uses inside GTK in https://gitlab.gnome.org/GNOME/gtk/blob/8d1a2247/gtk/gtkpopovermenu.c#L173 is already wrong because of this as it would popdown the popover while the popover is still focused.
Is my argument correct and we should change this or am I missing something?
Edited by Benjamin Otte