[Libreoffice-commits] core.git: vcl/qt5
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 15 07:44:38 UTC 2021
vcl/qt5/Qt5Frame.cxx | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
New commits:
commit cf5cc42785eae15dc19f06f391d614832b16be20
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Apr 15 00:37:55 2021 +0200
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Thu Apr 15 09:43:59 2021 +0200
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 at fbihome.de>
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)
More information about the Libreoffice-commits
mailing list