[Libreoffice-commits] core.git: vcl/qt5

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 1 09:52:59 UTC 2020


 vcl/qt5/Qt5Frame.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 06fb3e7b7f1079c276ad2f048cd94299b4bd7006
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Tue Jun 30 17:41:53 2020 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Wed Jul 1 11:52:21 2020 +0200

    tdf#132172 Qt5 just handle visible widget's focus
    
    I investigated the state of isWindow() and the SalFrameToTop
    flags for the detached find toolbar (tdf#126607) and the Impress
    presentation and the tabbed "page size" drop-down and all had the
    same status (isWin: 1, flags: 12). Than I had a look at the gtk3
    implementation, which just handles focus requests, if the widget
    is already mapped (gtk_widget_get_mapped).
    
    So I also dumped the visibility as the nearest equivalent in Qt to
    the X11 mapped state, and that was different. In the end Qt now
    also just handles the focus for already visible widgets, like
    gtk3, which works for all the cases I tested (incl. tdf#125517).
    
    And omiting either activateWindow or setFocus breaks some cases...
    and I still don't understand the GrabFocusOnly flag, which is just
    handled in the X11 backends at all...
    
    Note: this doesn't happen with 7.0+, because the weld'ed version
    of that control (commit 3afc718eddcd81232392d46fccc24b8ec626c8df
    "rework PageSizePopup to be a PopupWindowController") doesn't
    expose this bug (and also doesn't support mouse-over highlight).
    
    Change-Id: Id085732f6a52bbc69ed47fbd3d57454756a03121
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97549
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index ed3368ac3970..845b5860e713 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -764,7 +764,8 @@ void Qt5Frame::ToTop(SalFrameToTop nFlags)
         pWidget->raise();
     if ((nFlags & SalFrameToTop::RestoreWhenMin) || (nFlags & SalFrameToTop::ForegroundTask))
         pWidget->activateWindow();
-    else if ((nFlags & SalFrameToTop::GrabFocus) || (nFlags & SalFrameToTop::GrabFocusOnly))
+    else if ((nFlags & (SalFrameToTop::GrabFocus | SalFrameToTop::GrabFocusOnly))
+             && pWidget->isVisible())
     {
         pWidget->activateWindow();
         pWidget->setFocus();


More information about the Libreoffice-commits mailing list