summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/app/salinst.cxx5
-rw-r--r--vcl/win/app/saltimer.cxx3
2 files changed, 6 insertions, 2 deletions
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index cfffb97d0234..6458fca73c43 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -644,6 +644,8 @@ bool WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong
if( ImplGetSVData()->maAppData.mnModalMode )
Sleep(1);
else
+ // If you change the SendMessageW function, you might need to update
+ // the PeekMessage( ... PM_QS_POSTMESSAGE) calls!
bDidWork = SendMessageW( mhComWnd, SAL_MSG_THREADYIELD, (WPARAM)bWait, (LPARAM)bHandleAllCurrentEvents );
ImplSalAcquireYieldMutex( nCount );
@@ -729,8 +731,9 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, i
break;
case SAL_MSG_TIMER_CALLBACK:
MSG aMsg;
+ // PM_QS_POSTMESSAGE is needed, so we don't process the SendMessage from DoYield!
while ( PeekMessageW(&aMsg, nullptr, SAL_MSG_TIMER_CALLBACK,
- SAL_MSG_TIMER_CALLBACK, PM_REMOVE | PM_NOYIELD) )
+ SAL_MSG_TIMER_CALLBACK, PM_REMOVE | PM_NOYIELD | PM_QS_POSTMESSAGE) )
assert( "Multiple timer messages in queue" );
assert( 0 == wParam );
if ( 0 == wParam )
diff --git a/vcl/win/app/saltimer.cxx b/vcl/win/app/saltimer.cxx
index 4ca5ebb572d2..847ff52851b8 100644
--- a/vcl/win/app/saltimer.cxx
+++ b/vcl/win/app/saltimer.cxx
@@ -46,10 +46,11 @@ void ImplSalStopTimer()
// remove all pending SAL_MSG_TIMER_CALLBACK messages
// we always have to do this, since ImplSalStartTimer with 0ms just queues
// a new SAL_MSG_TIMER_CALLBACK message
+ // PM_QS_POSTMESSAGE is needed, so we don't process the SendMessage from DoYield!
MSG aMsg;
int nMsgCount = 0;
while ( PeekMessageW(&aMsg, nullptr, SAL_MSG_TIMER_CALLBACK,
- SAL_MSG_TIMER_CALLBACK, PM_REMOVE | PM_NOYIELD) )
+ SAL_MSG_TIMER_CALLBACK, PM_REMOVE | PM_NOYIELD | PM_QS_POSTMESSAGE) )
nMsgCount++;
assert( nMsgCount <= 1 );
pSalData->mbOnIdleRunScheduler = false;