summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-06-30 17:41:53 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2020-07-01 15:12:26 +0200
commit14eccc62b53e202cd9ed63442481922a320fc02e (patch)
treee7548fd7091d48aa3723bdfb50f99b5185355c50
parentb3446f2dbe513ff3ca6a54bf3845df7a0787f61c (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> (cherry picked from commit 06fb3e7b7f1079c276ad2f048cd94299b4bd7006) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97575
-rw-r--r--vcl/qt5/Qt5Frame.cxx3
1 files changed, 2 insertions, 1 deletions
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();