[Libreoffice-commits] core.git: vcl/win

Juergen Funk (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 28 12:26:06 UTC 2019


 vcl/win/gdi/salprn.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit c16bfef0d51ad903defdb2bacb4550de481d3074
Author:     Juergen Funk <juergen.funk_ml at cib.de>
AuthorDate: Tue Aug 27 09:22:17 2019 +0200
Commit:     Juergen Funk (CIB) <juergen.funk_ml at cib.de>
CommitDate: Wed Aug 28 14:23:11 2019 +0200

    tdf#127192 Printing in main thread
    
    the wollmux has change the dialogs form swing to the LO-Dialogs,
    and when printig with MS-PDF then LO hang on this line.
    The reason is wollmux run in it own thread, but this thread has
    no win-message-pump, when the printer-driver would open the
    FileSave-Dialog then it hangs, because the message-pump
    is missing in this thread.
    
    The swing has made it own win-message-pump for this
    thread.
    
    Change-Id: Ia5131464dcc5f166133a3302d29550e945dd1026
    Reviewed-on: https://gerrit.libreoffice.org/78170
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
    Reviewed-by: Juergen Funk (CIB) <juergen.funk_ml at cib.de>
    Tested-by: Juergen Funk (CIB) <juergen.funk_ml at cib.de>

diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx
index 8119bad8cdb7..73ade5080c55 100644
--- a/vcl/win/gdi/salprn.cxx
+++ b/vcl/win/gdi/salprn.cxx
@@ -52,6 +52,8 @@
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <comphelper/processfactory.hxx>
 
+#include <vcl/threadex.hxx>
+
 #include <malloc.h>
 
 #include <winspool.h>
@@ -1502,8 +1504,8 @@ bool WinSalPrinter::StartJob( const OUString* pFileName,
     else
         aInfo.lpszOutput = nullptr;
 
-    // start Job
-    int nRet = lcl_StartDocW( hDC, &aInfo, this );
+    // start Job, in the main thread
+    int nRet = vcl::solarthread::syncExecute([hDC, this, &aInfo]() -> int { return lcl_StartDocW(hDC, &aInfo, this); });
 
     if ( nRet <= 0 )
     {


More information about the Libreoffice-commits mailing list