diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-11-18 13:02:52 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-11-18 18:42:59 +0100 |
commit | 4e770803c63417791cf2e38e27ec85127056b7a5 (patch) | |
tree | 11dbaaa0f71bcaecfaa54543b207eadab2e18c63 /vcl/qt5/QtInstanceRadioButton.cxx | |
parent | b223a06401c0b82a37bf5bb288397b6c5314eab9 (diff) |
tdf#163792 gtk3: Don't always focus combobox when its popup closes
Since
commit 405cf00e4818886b0d3053d03cfb2e3f3a5e8eb8
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Tue May 28 11:50:12 2024 +0200
related tdf#160971 gtk3 a11y: Keep new combobox value
, closing an (editable) combobox like the font size one
in the Writer formatting toolbar resulted in the combobox's entry
having focus, while the focus was set to the document before that
commit.
Make this work as expected (again), by making grabbing the
focus conditional in 2 places:
1) In GtkInstanceComboBox::signal_popup_toggled,
only set the focus to the GtkEntry of the custom
combobox implementation if the child focus is already
inside of the combobox. As I understand it, the intended
logic is "move focus from the combo box's button to its entry",
not "unconditionally grab the focus".
This also matches what the gtk4 implementation does. Sync the
comment from the gtk4 implementation, which explicitly
mentions the case of the font combobox in the toolbar (which
behaves the same as the font size one in that regard) where
focus should not be grabbed.
2) In GtkComboBox::menu_toggled, only explicitly set focus to
the toggle button if the combo box is located inside of a popup.
This is the same condition used to grab all keyboard events.
The code to do both was introduced in
commit 131c1c7da8c567636ca55751e49d24cb6d6c9b9e
Date: Sun Nov 21 19:53:47 2021 +0000
Related: tdf#145786 cooperate between our own grabs
whose commit message only explicitly mentions grabs
for popups. The scenarios described in the commit message
still work as expected with GDK_BACKEND=x11.
With this in place, focus now moves to the document
as expected when clicking on a combobox entry in the popup
for the font size combobox in Writer's formatting toolbar,
while clicking an entry in any of the comboboxes in e.g.
Writer's "Format" -> "Character" dialog's "Font" tab still
results in the entry of the combobox getting focus.
Change-Id: Ib07b034f8327dab19a2264ae3ed8e20ea918dd89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176713
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/qt5/QtInstanceRadioButton.cxx')
0 files changed, 0 insertions, 0 deletions