summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-04-15 00:37:55 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2021-04-15 09:43:59 +0200
commitcf5cc42785eae15dc19f06f391d614832b16be20 (patch)
tree1d53afe04f34efc2bcf86c89194251c1d8767105
parent9536eb17ed6204e2e67e4f6173c0118c1b80e94f (diff)
Qt5 correctly focus the navigator window
Handle SalFrame::Show's bNoActivate. The missing implementation became visible with commit 001cf630f14109b4200b218161418350562713fa ("register navigator individually in each module that it exists in") Change-Id: I5edf43bdf2b0460410fdd846c7698d00299088bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114116 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--vcl/qt5/Qt5Frame.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 97cc7e938446..eb043ae1862a 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -412,16 +412,26 @@ void Qt5Frame::DrawMenuBar() { /* not needed */}
void Qt5Frame::SetExtendedFrameStyle(SalExtStyle /*nExtStyle*/) { /* not needed */}
-void Qt5Frame::Show(bool bVisible, bool /*bNoActivate*/)
+void Qt5Frame::Show(bool bVisible, bool bNoActivate)
{
assert(m_pQWidget);
+ if (bVisible == asChild()->isVisible())
+ return;
SetDefaultSize();
SetDefaultPos();
auto* pSalInst(static_cast<Qt5Instance*>(GetSalData()->m_pInstance));
assert(pSalInst);
- pSalInst->RunInMainThread([this, bVisible]() { asChild()->setVisible(bVisible); });
+ pSalInst->RunInMainThread([this, bVisible, bNoActivate]() {
+ asChild()->setVisible(bVisible);
+ asChild()->raise();
+ if (!bNoActivate)
+ {
+ asChild()->activateWindow();
+ asChild()->setFocus();
+ }
+ });
}
void Qt5Frame::SetMinClientSize(tools::Long nWidth, tools::Long nHeight)