Kaydet (Commit) 5bb798a9 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst ee6787fc
...@@ -14,6 +14,7 @@ $(eval $(call gb_Library_set_componentfile,emboleobj,embeddedobj/source/msole/em ...@@ -14,6 +14,7 @@ $(eval $(call gb_Library_set_componentfile,emboleobj,embeddedobj/source/msole/em
$(eval $(call gb_Library_set_include,emboleobj,\ $(eval $(call gb_Library_set_include,emboleobj,\
-I$(SRCDIR)/embeddedobj/source/inc \ -I$(SRCDIR)/embeddedobj/source/inc \
$(if $(filter WNT,$(OS)),-I$(SRCDIR)/vcl/inc) \
$$(INCLUDE) \ $$(INCLUDE) \
)) ))
......
...@@ -44,6 +44,10 @@ ...@@ -44,6 +44,10 @@
#include <oledlg.h> #include <oledlg.h>
#include <svsys.h>
#include <win/saldata.hxx>
#include <win/salinst.h>
class InitializedOleGuard class InitializedOleGuard
{ {
public: public:
...@@ -174,6 +178,11 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia ...@@ -174,6 +178,11 @@ embed::InsertedObjectInfo SAL_CALL MSOLEDialogObjectCreator::createInstanceByDia
if( !pInsertFct ) if( !pInsertFct )
throw uno::RuntimeException(); 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); uTemp=pInsertFct(&io);
if ( OLEUI_OK != uTemp ) if ( OLEUI_OK != uTemp )
......
...@@ -269,6 +269,8 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 ); ...@@ -269,6 +269,8 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
#define SAL_MSG_TIMER_CALLBACK (WM_USER+162) #define SAL_MSG_TIMER_CALLBACK (WM_USER+162)
// Stop the timer from the main thread; wParam = 0, lParam = 0 // Stop the timer from the main thread; wParam = 0, lParam = 0
#define SAL_MSG_STOPTIMER (WM_USER+163) #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 ) inline void SetWindowPtr( HWND hWnd, WinSalFrame* pThis )
{ {
......
...@@ -620,6 +620,11 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, b ...@@ -620,6 +620,11 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, b
pTimer->ImplHandle_WM_TIMER( wParam ); pTimer->ImplHandle_WM_TIMER( wParam );
break; break;
case SAL_MSG_FORCE_REAL_TIMER:
assert(pTimer != nullptr);
pTimer->SetForceRealTimer(true);
break;
case SAL_MSG_DUMMY: case SAL_MSG_DUMMY:
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment