Try this in Calc, Sidebar decks Styles, Gallery and Navigator: 1. Focus into panel 2. Hit Esc repeatedly Result: focus remains inside the deck even though it should move to document as per Sidebar guidelines. This regressed with 9ca60dc90958001c078ed6331bd432c36961a425 tdf#156156 Add Help button to sidebar decks Debugging what happens when I hit Esc while in Styles, what I can see is that in the FocusManager::GetFocusLocation() function of sfx2/source/sidebar/FocusManager.cxx, the condition in the panel search loop: if (pContents->has_child_focus()) return FocusLocation(PC_PanelContent, nIndex); reports has_child_focus() as being true *while I am focused in the Cell Styles button in the toolbar*! So it incorrectly reports the focus location to be PC_PanelContent. This results in a no-op for the user hitting Esc. I suppose this has to do with the rework of sfx2/uiconfig/ui/deck.ui To be exact, the has_child_focus() function that is called is: SalInstanceWidget::has_child_focus at vcl/source/app/salvtables.cxx:396 That then does calls leading to Window::ImplIsChild() in vcl/source/window/stacking.cxx I'm not sure where this should be fixed: the .ui file or FocusManager::GetFocusLocation() ?
Reproduced in: Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 70b3e128aef631e18e6451362c2e6315c28b857e CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: CL threaded
(In reply to Buovjaga from comment #0) > Try this in Calc, Sidebar decks Styles, Gallery and Navigator: > 1. Focus into panel > 2. Hit Esc repeatedly > > Result: focus remains inside the deck even though it should move to document > as per Sidebar guidelines. > > This regressed with 9ca60dc90958001c078ed6331bd432c36961a425 > tdf#156156 Add Help button to sidebar decks > > Debugging what happens when I hit Esc while in Styles, what I can see is > that in the FocusManager::GetFocusLocation() function of > sfx2/source/sidebar/FocusManager.cxx, the condition in the panel search loop: > > if (pContents->has_child_focus()) > return FocusLocation(PC_PanelContent, nIndex); > > reports has_child_focus() as being true *while I am focused in the Cell > Styles button in the toolbar*! So it incorrectly reports the focus location > to be PC_PanelContent. This results in a no-op for the user hitting Esc. I think the result from pContents->has_child_focus() being true is correct. It seems to me the problem is with the PC_PanelContent handling for Esc in the FocusManager::HandleKeyEvent function: case PC_PanelContent: // Return focus to tab bar sidebar settings button or panel title. // The deck title is not visible when sidebar is floating but maybe we shouldn't check for this and treat both floating and docked the same? if (!IsDeckTitleVisible() && maPanels.size() == 1) FocusButton(0); // Or maybe just return to the document when there is only one panel in the deck? if (maPanels.size() == 1) { if (mxDeck) mxDeck->GrabFocusToDocument(); } // more than one panel so focus on the panel title/expander else FocusPanel(aLocation.mnIndex, true); bConsumed = true; break;
Or FocusDeckTitle() when there is only one panel in a deck. I think at one time the behavior was this.
Thanks @Jim for the pointers. This patch fixes the issue: https://gerrit.libreoffice.org/c/core/+/169668
Rafael Lima committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6113d5dc45232b602bee0e68cf7560d0b8656546 tdf#161782 Focus document when Esc is pressed in the Gallery/Navigator It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
The submitted patch fixes the issue when the sidebar is docked. Pressing Esc the first time will focus the Tab bar, and pressing Esc again will focus the document. As discussed in the patch, when the sidebar is floating, focusing the document still does not work in all VCL plugins.
Verified fix Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 450739e92e6f90060e5fdfa42ae291b1abaebd7a CPU threads: 8; OS: Linux 6.9; UI render: default; VCL: kf6 (cairo+wayland) Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: CL threaded