svtools/source/control/toolbarmenu.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 6c74c916652e38017c0097c131353d96b70e5414
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Jan 12 19:58:18 2020 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Jan 13 09:41:56 2020 +0100

    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 <caol...@redhat.com>

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();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to