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

New commits:
commit 14eccc62b53e202cd9ed63442481922a320fc02e
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Tue Jun 30 17:41:53 2020 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Wed Jul 1 15:12:26 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.wegh...@posteo.de>
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>
    (cherry picked from commit 06fb3e7b7f1079c276ad2f048cd94299b4bd7006)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97575

diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index b38b92f143c9..25be0a1a4bc9 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -758,7 +758,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();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to