[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/qt5

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Mar 18 23:01:29 UTC 2019


 vcl/qt5/Qt5Frame.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit d7e335018979e4c6d56f5f6ef152fcef1dd5ad9b
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Thu Mar 14 22:35:38 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Mar 19 00:01:06 2019 +0100

    tdf#119718: give focus where focus is due
    
    shamelessly copied X11SalFrame behaviour with different ToTopFlags:
    focus central widget with GrabFocus and GrabFocusOnly, activate
    window when coming back from minimized (RestoreWhenMin) or coming
    back to foreground (ForegroundTask)
    
    Change-Id: I4d43a00f0a9034e661303c39a1b522def85ab6f5
    Reviewed-on: https://gerrit.libreoffice.org/69285
    Tested-by: Jenkins
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit 39396a2e4362608c792cf3bdde447b66c75d64d6)
    Reviewed-on: https://gerrit.libreoffice.org/69402
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 334466770fd1..57a2cb219b52 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -640,8 +640,10 @@ void Qt5Frame::ToTop(SalFrameToTop nFlags)
 
     if (isWindow() && !(nFlags & SalFrameToTop::GrabFocusOnly))
         pWidget->raise();
-    pWidget->setFocus();
-    pWidget->activateWindow();
+    if ((nFlags & SalFrameToTop::RestoreWhenMin) || (nFlags & SalFrameToTop::ForegroundTask))
+        pWidget->activateWindow();
+    else if ((nFlags & SalFrameToTop::GrabFocus) || (nFlags & SalFrameToTop::GrabFocusOnly))
+        m_pQWidget->setFocus();
 }
 
 void Qt5Frame::SetPointer(PointerStyle ePointerStyle)


More information about the Libreoffice-commits mailing list