diff options
-rw-r--r-- | sd/source/ui/dlg/navigatr.cxx | 42 | ||||
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/inc/sdtreelb.hxx | 1 |
3 files changed, 19 insertions, 31 deletions
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index ff38bfbb2bc7..c6eed54865a8 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -464,33 +464,27 @@ IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl, weld::TreeView&, bool) // state update. mpBindings->Update(); - // moved here from SetGetFocusHdl. Reset the - // focus only if something has been selected in the - // document. - SfxViewShell* pCurSh = SfxViewShell::Current(); - - if ( pCurSh ) + if (mxTlbObjects->IsNavigationGrabsFocus()) { - vcl::Window* pShellWnd = pCurSh->GetWindow(); - if ( pShellWnd ) - pShellWnd->GrabFocus(); - } + // moved here from SetGetFocusHdl. Reset the + // focus only if something has been selected in the + // document. + SfxViewShell* pCurSh = SfxViewShell::Current(); - // We navigated to an object, but the current shell may be - // still the slide sorter. Explicitly try to grab the draw - // shell focus, so follow-up operations work with the object - // and not with the whole slide. - vcl::Window* pWindow = pViewShell->GetActiveWindow(); - if (pWindow) - pWindow->GrabFocus(); + if ( pCurSh ) + { + vcl::Window* pShellWnd = pCurSh->GetWindow(); + if ( pShellWnd ) + pShellWnd->GrabFocus(); + } - if (!mxTlbObjects->IsNavigationGrabsFocus()) - { - // This is the case when keyboard navigation inside the - // navigator should continue to work. - if (mxNavigatorDlg) - mxNavigatorDlg->GrabFocus(); - mxTlbObjects->grab_focus(); + // We navigated to an object, but the current shell may be + // still the slide sorter. Explicitly try to grab the draw + // shell focus, so follow-up operations work with the object + // and not with the whole slide. + vcl::Window* pWindow = pViewShell->GetActiveWindow(); + if (pWindow) + pWindow->GrabFocus(); } } } diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 7eb476cfb48b..69001315e936 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -306,7 +306,6 @@ IMPL_LINK(SdPageObjsTLV, CommandHdl, const CommandEvent&, rCEvt, bool) if (rCEvt.GetCommand() == CommandEventId::ContextMenu) { - m_bMouseReleased = false; m_xTreeView->grab_focus(); // select clicked entry @@ -321,7 +320,6 @@ IMPL_LINK(SdPageObjsTLV, CommandHdl, const CommandEvent&, rCEvt, bool) } bool bRet = m_aPopupMenuHdl.Call(rCEvt); - m_bMouseReleased = true; return bRet; } @@ -362,7 +360,6 @@ IMPL_LINK(SdPageObjsTLV, KeyInputHdl, const KeyEvent&, rKEvt, bool) IMPL_LINK(SdPageObjsTLV, MousePressHdl, const MouseEvent&, rMEvt, bool) { - m_bMouseReleased = false; m_bEditing = false; m_bSelectionHandlerNavigates = rMEvt.GetClicks() == 1; m_bNavigationGrabsFocus = rMEvt.GetClicks() != 1; @@ -371,7 +368,6 @@ IMPL_LINK(SdPageObjsTLV, MousePressHdl, const MouseEvent&, rMEvt, bool) IMPL_LINK_NOARG(SdPageObjsTLV, MouseReleaseHdl, const MouseEvent&, bool) { - m_bMouseReleased = true; if (m_aMouseReleaseHdl.IsSet() && m_aMouseReleaseHdl.Call(MouseEvent())) return false; @@ -850,8 +846,7 @@ void SdPageObjsTLV::Select() { m_nSelectEventId = nullptr; - // m_bMouseReleased is a hack to make inplace editing work for X11 - if (m_bMouseReleased) + if (IsEditingActive()) return; m_bLinkableSelected = true; diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 6759c299cda1..1b8f3683179e 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -102,7 +102,6 @@ private: */ bool m_bNavigationGrabsFocus; - bool m_bMouseReleased = true; // hack for x11 inplace editing bool m_bEditing = false; SelectionMode m_eSelectionMode; |