https://bugs.documentfoundation.org/show_bug.cgi?id=161782

--- Comment #2 from Jim Raykowski <rayk...@gmail.com> ---
(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;

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to