diff options
Diffstat (limited to 'vcl/qt5/QtFrame.cxx')
-rw-r--r-- | vcl/qt5/QtFrame.cxx | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx index 7723967c1537..fb3c5b66b0de 100644 --- a/vcl/qt5/QtFrame.cxx +++ b/vcl/qt5/QtFrame.cxx @@ -410,32 +410,36 @@ void QtFrame::SetExtendedFrameStyle(SalExtStyle /*nExtStyle*/) { /* not needed * void QtFrame::Show(bool bVisible, bool bNoActivate) { + SolarMutexGuard g; + QtInstance* pQtInstance = GetQtInstance(); + assert(pQtInstance); + if (!pQtInstance->IsMainThread()) + { + pQtInstance->RunInMainThread([&] { Show(bVisible, bNoActivate); }); + return; + } + assert(m_pQWidget); if (bVisible == asChild()->isVisible()) return; - auto* pSalInst(GetQtInstance()); - assert(pSalInst); - if (!bVisible) // hide { - pSalInst->RunInMainThread([this]() { asChild()->setVisible(false); }); + asChild()->setVisible(false); return; } // show SetDefaultSize(); - pSalInst->RunInMainThread([this, bNoActivate]() { - QWidget* const pChild = asChild(); - pChild->setVisible(true); - pChild->raise(); - if (!bNoActivate) - { - pChild->activateWindow(); - pChild->setFocus(); - } - }); + QWidget* const pChild = asChild(); + pChild->setVisible(true); + pChild->raise(); + if (!bNoActivate) + { + pChild->activateWindow(); + pChild->setFocus(); + } } void QtFrame::SetMinClientSize(tools::Long nWidth, tools::Long nHeight) |