focus: fall back to old behaviour if we didn't focus anything
authorAdam Williamson <awilliam@redhat.com>
Wed, 2 Nov 2022 00:26:29 +0000 (17:26 -0700)
committerAdam Williamson <awilliam@redhat.com>
Wed, 2 Nov 2022 16:32:32 +0000 (09:32 -0700)
commite07f8ef50657dab0d5184d4c6927acc0683bc07d
tree47ddd069d1ec675e4850e147c1c3f4877d9a4792
parenta272887c3490b62264bfce0085ae0043be75ce08
focus: fall back to old behaviour if we didn't focus anything

8455b9ac74 seems to have introduced a problem where we can wind
up focusing no widget at all if the `while (parent)` loop doesn't
find a widget it can successfully move the focus to. This 'fixes'
that by falling back to doing the previous thing if we make it
all the way through that loop without moving the focus. Thanks to
@coreyberla for a hint to improve the implementation.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
gtk/gtkwindow.c