Skip to content

Focus-on-click improvements

Sergey Bugaev requested to merge bugaevc/gtk:focus-on-click into main

This is an attempt to make unsetting focus-on-click (to prevent headerbar buttons and the like from taking over focus from in-window widgets) work in more cases, specifically with menu buttons that open popovers.

The popover now attempts to remember which widget had focus when the popover was opened, and restore focus to that widget when the popover get closed (previously, the focus would go to the popover's parent, the menu button, following the generic logic for hiding a focused widget). This functionality existed in GTK 3, and in GTK 4 GtkStackView does a similar thing, where it tracks a last focused widget per-page and restores focus on page change. (That part was split into !6394)

This goes with libadwaita!965

Edited by Sergey Bugaev

Merge request reports