diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-06-30 17:41:53 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-07-01 11:52:21 +0200 |
commit | 06fb3e7b7f1079c276ad2f048cd94299b4bd7006 (patch) | |
tree | c84e094eecfc52754a57f76f387ee3aa2f930c31 /vcl/qt5 | |
parent | 3dfc6d42edfd469436ad177ad1ebc5526679aa99 (diff) |
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@posteo.de>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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(); |