From 5bb798a99e7b178ac57ee8c15238534723000bf9 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Wed, 12 Dec 2018 16:11:35 +0100 Subject: tdf#117295 WIN no main loop shortcut for OLE dialog Normally we handle Idle events directly without posting events to the main event queue, as there seem to be no way to post them to the end of the queue and this starves system events. This prevents using this short-cut, as the default Windows event processing doesn't know of this special handling. Eventually this hack should be removed by simply always processing all pending events... Change-Id: If9ae81ca7e847743f9251343e106dbf566371584 Reviewed-on: https://gerrit.libreoffice.org/65040 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski --- embeddedobj/source/msole/xdialogcreator.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'embeddedobj/source') diff --git a/embeddedobj/source/msole/xdialogcreator.cxx b/embeddedobj/source/msole/xdialogcreator.cxx index f94020a65a8f..be26a300d298 100644 --- a/embeddedobj/source/msole/xdialogcreator.cxx +++ b/embeddedobj/source/msole/xdialogcreator.cxx @@ -44,6 +44,10 @@ #include +#include +#include +#include + class InitializedOleGuard { public: @@ -174,6 +178,11 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia if( !pInsertFct ) throw uno::RuntimeException(); + // Disable any event loop shortcuts by enabling a real timer. + // This way the native windows dialog won't block our own processing. + BOOL const ret = PostMessageW(GetSalData()->mpInstance->mhComWnd, SAL_MSG_FORCE_REAL_TIMER, 0, 0); + SAL_WARN_IF(0 == ret, "embeddedobj.ole", "ERROR: PostMessage() failed!"); + uTemp=pInsertFct(&io); if ( OLEUI_OK != uTemp ) -- cgit