summaryrefslogtreecommitdiff
path: root/editors/libreoffice/files/patch-vcl_qt5_Qt5Instance.cxx
blob: f7a46f48d2826098bdf0331ececb56097f1de319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--- vcl/qt5/Qt5Instance.cxx.orig	2020-05-13 11:19:20 UTC
+++ vcl/qt5/Qt5Instance.cxx
@@ -287,7 +287,13 @@ SalFrame* Qt5Instance::CreateChildFrame(SystemParentDa
 SalFrame* Qt5Instance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle)
 {
     assert(!pParent || dynamic_cast<Qt5Frame*>(pParent));
-    return new Qt5Frame(static_cast<Qt5Frame*>(pParent), nStyle, m_bUseCairo);
+    SalFrame* pRet(nullptr);
+    bool bUseCairo = m_bUseCairo;
+    RunInMainThread([&pRet, pParent, nStyle, bUseCairo]() {
+        pRet = new Qt5Frame(static_cast<Qt5Frame*>(pParent), nStyle, bUseCairo);
+    });
+    assert(pRet);
+    return pRet;
 }
 
 void Qt5Instance::DestroyFrame(SalFrame* pFrame)
@@ -458,7 +464,7 @@ Qt5Instance::createPicker(css::uno::Reference<css::uno
     {
         SolarMutexGuard g;
         rtl::Reference<Qt5FilePicker> pPicker;
-        RunInMainThread([&, this]() { pPicker = createPicker(context, eMode); });
+        RunInMainThread([&pPicker, this, context, eMode]() { pPicker = createPicker(context, eMode); });
         assert(pPicker);
         return pPicker;
     }
@@ -663,7 +669,7 @@ std::unique_ptr<QApplication> Qt5Instance::CreateQAppl
 extern "C" {
 VCLPLUG_QT5_PUBLIC SalInstance* create_SalInstance()
 {
-    static const bool bUseCairo = (nullptr != getenv("SAL_VCL_QT5_USE_CAIRO"));
+    static const bool bUseCairo = true; // (nullptr != getenv("SAL_VCL_QT5_USE_CAIRO"));
 
     std::unique_ptr<char* []> pFakeArgv;
     std::unique_ptr<int> pFakeArgc;