summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-12 19:58:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-13 09:41:56 +0100
commit6c74c916652e38017c0097c131353d96b70e5414 (patch)
treeac23de9cefc1741fbc4a9ea5489f72e98f732a82 /svtools
parentd5047c4a1cbae1cb2b57ed435ecd63e6817506d3 (diff)
if these popups have focus on dispose put focus into document
instead of an arbitrary window Change-Id: Ib3af0ba6dabe94026b8548e88f7ecdc35907606f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86646 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/toolbarmenu.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 7d74380a2d10..90bd3f3b53aa 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -1593,6 +1593,13 @@ void InterimToolbarPopup::GetFocus()
void InterimToolbarPopup::dispose()
{
+ // if we have focus when disposed, pick the document window as destination
+ // for focus rather than let it go to an arbitrary windows
+ if (HasFocus())
+ {
+ if (auto xWindow = mxFrame->getContainerWindow())
+ xWindow->setFocus();
+ }
// move the contents back where it belongs
m_xContainer->move(m_xPopup->getContainer(), m_xPopup->getTopLevel());
m_xPopup.reset();