summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <jan-marek.glogowski@extern.cib.de>2019-11-25 14:08:44 +0000
committerKatarina Behrens <Katarina.Behrens@cib.de>2019-11-27 12:36:55 +0100
commitadbd20017ba9ac4cb2e20195f715904d9b11bc17 (patch)
treeb7f997e7dc8299dd76048756a35d7236a479145e /vcl
parent835f0e940a600cfac0ac41efb8a4e6015a122dd7 (diff)
tdf#126607 Qt5 activate window before setFocus
.., and prevent Qt5MainWindow to take any focus. Our top level Qt5MainWindow shouldn't handle focus directly, as it's always completely drawn by the child Qt5Widget, which also handles input. So prevent any direct focus handling by setting the Qt5Widget as the focus proxy of the Qt5MainWindow. Also setting the focus of the child widget on its own seems to do nothing at all. At least I didn't see any difference after commenting the code block. But it at least has some effect, if you call setFocus on the real window, but that breaks Impress full screen mode, which somehow gets scroll bars?! Not that I understand why this is needed. At least the original X11 code just calls XSetInputFocus in this case. Change-Id: I591c031a17a7ae0b5486760cd1802522d4088678 Reviewed-on: https://gerrit.libreoffice.org/83689 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit ec554ac30236fa7949e9866d01319d4e3e88c983) Reviewed-on: https://gerrit.libreoffice.org/83838 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/Qt5Frame.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 47bfb357c2a5..2ca319ee515c 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -153,6 +153,7 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
m_pTopLevel = new Qt5MainWindow(*this, pParentWidget, aWinFlags);
m_pQWidget = new Qt5Widget(*this, aWinFlags);
m_pTopLevel->setCentralWidget(m_pQWidget);
+ m_pTopLevel->setFocusProxy(m_pQWidget);
}
else
m_pQWidget = new Qt5Widget(*this, aWinFlags);
@@ -684,7 +685,10 @@ void Qt5Frame::ToTop(SalFrameToTop nFlags)
if ((nFlags & SalFrameToTop::RestoreWhenMin) || (nFlags & SalFrameToTop::ForegroundTask))
pWidget->activateWindow();
else if ((nFlags & SalFrameToTop::GrabFocus) || (nFlags & SalFrameToTop::GrabFocusOnly))
- m_pQWidget->setFocus();
+ {
+ pWidget->activateWindow();
+ pWidget->setFocus();
+ }
}
void Qt5Frame::SetPointer(PointerStyle ePointerStyle)