diff options
-rw-r--r-- | embeddedobj/Library_emboleobj.mk | 1 | ||||
-rw-r--r-- | embeddedobj/source/msole/xdialogcreator.cxx | 9 | ||||
-rw-r--r-- | vcl/inc/win/saldata.hxx | 2 | ||||
-rw-r--r-- | vcl/win/app/salinst.cxx | 5 |
4 files changed, 17 insertions, 0 deletions
diff --git a/embeddedobj/Library_emboleobj.mk b/embeddedobj/Library_emboleobj.mk index 9e3c1b5950d2..3bfbec56d89d 100644 --- a/embeddedobj/Library_emboleobj.mk +++ b/embeddedobj/Library_emboleobj.mk @@ -14,6 +14,7 @@ $(eval $(call gb_Library_set_componentfile,emboleobj,embeddedobj/source/msole/em $(eval $(call gb_Library_set_include,emboleobj,\ -I$(SRCDIR)/embeddedobj/source/inc \ + $(if $(filter WNT,$(OS)),-I$(SRCDIR)/vcl/inc) \ $$(INCLUDE) \ )) 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 <oledlg.h> +#include <svsys.h> +#include <win/saldata.hxx> +#include <win/salinst.h> + 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 ) diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index d036ffb30a23..74be79774db5 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -269,6 +269,8 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 ); #define SAL_MSG_TIMER_CALLBACK (WM_USER+162) // Stop the timer from the main thread; wParam = 0, lParam = 0 #define SAL_MSG_STOPTIMER (WM_USER+163) +// Start a real timer while GUI is blocked by native dialog +#define SAL_MSG_FORCE_REAL_TIMER (WM_USER+164) inline void SetWindowPtr( HWND hWnd, WinSalFrame* pThis ) { diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index 7011f8b2404b..6e0e3057ae40 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -620,6 +620,11 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, b pTimer->ImplHandle_WM_TIMER( wParam ); break; + case SAL_MSG_FORCE_REAL_TIMER: + assert(pTimer != nullptr); + pTimer->SetForceRealTimer(true); + break; + case SAL_MSG_DUMMY: break; |