vcl/inc/svdata.hxx        |    1 +
 vcl/source/app/svapp.cxx  |    2 +-
 vcl/source/app/svmain.cxx |    3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 4201779de7441c03fbf0fea665d17ed2328970cc
Author:     Markus Mohrhard <markus.mohrh...@googlemail.com>
AuthorDate: Wed Nov 7 20:59:22 2018 +0100
Commit:     Markus Mohrhard <markus.mohrh...@googlemail.com>
CommitDate: Thu Nov 8 02:53:17 2018 +0100

    Revert "Use the backend SalInstance method IsMainThread for 
Application::IsMainThread"
    
    vcl/inc/unx/gtk/gtkinst.hxx's IsMainThread returns always false.
    
    This breaks in iahndl.cxx on Linux.
    
    This reverts commit bc089afb13029bae65b993992b3815430657ac24.
    
    Change-Id: I8fbd945e3704214d242f6f9e65760d44b0cc7d40
    Reviewed-on: https://gerrit.libreoffice.org/63044
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    Tested-by: Jenkins

diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 62f07929e031..b36ecf7e6a41 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -363,6 +363,7 @@ struct ImplSVData
     std::unique_ptr<DockingManager> mpDockingManager;
     std::unique_ptr<BlendFrameCache> mpBlendFrameCache;
 
+    oslThreadIdentifier     mnMainThreadId = 0;
     rtl::Reference< vcl::DisplayConnectionDispatch > mxDisplayConnection;
 
     css::uno::Reference< css::lang::XComponent > mxAccessBridge;
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 0d9a2770aeb8..3221804607e3 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -520,7 +520,7 @@ comphelper::SolarMutex& Application::GetSolarMutex()
 
 bool Application::IsMainThread()
 {
-    return ImplGetSVData()->mpDefInst->IsMainThread();
+    return ImplGetSVData()->mnMainThreadId == 
osl::Thread::getCurrentIdentifier();
 }
 
 sal_uInt32 Application::ReleaseSolarMutex()
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 86db558da3e9..673e800e4ac4 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -302,6 +302,9 @@ bool InitVCL()
 
     ImplSVData* pSVData = ImplGetSVData();
 
+    // remember Main-Thread-Id
+    pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier();
+
     // Initialize Sal
     pSVData->mpDefInst = CreateSalInstance();
     if ( !pSVData->mpDefInst )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to