Kaydet (Commit) 221b0ab1 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

WIN use Reschedule instead of own dispatch loops

Since we're filtering the wakeup timer event in the main dispatch
loop, we should use Application::Reschedule in the Backend.

Change-Id: Ie02c3533e8a6a7905281f129489e4f6f53f74692
üst fae4b848
......@@ -732,6 +732,7 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, i
while ( PeekMessageW(&aMsg, nullptr, SAL_MSG_TIMER_CALLBACK,
SAL_MSG_TIMER_CALLBACK, PM_REMOVE) )
assert( "Multiple timer messages in queue" );
assert( 0 == wParam );
if ( 0 == wParam )
EmitTimerCallback();
break;
......
......@@ -1288,24 +1288,12 @@ BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
{
SalData* pSalData = GetSalData();
WinSalPrinter* pPrinter;
bool bWhile = TRUE;
int i = 0;
bool bWhile = true;
do
{
// process messages
MSG aMsg;
if ( PeekMessageW( &aMsg, nullptr, 0, 0, PM_REMOVE ) )
{
TranslateMessage( &aMsg );
DispatchMessageW( &aMsg );
i++;
if ( i > 15 )
bWhile = FALSE;
}
else
bWhile = FALSE;
bWhile = Application::Reschedule( true );
pPrinter = pSalData->mpFirstPrinter;
while ( pPrinter )
......@@ -1468,25 +1456,7 @@ bool WinSalPrinter::StartJob( const OUString* pFileName,
// As the Telecom Balloon Fax driver tends to send messages repeatedly
// we try to process first all, and then insert a dummy message
bool bWhile = TRUE;
int i = 0;
do
{
// process messages
MSG aMsg;
if ( PeekMessageW( &aMsg, nullptr, 0, 0, PM_REMOVE ) )
{
TranslateMessage( &aMsg );
DispatchMessageW( &aMsg );
i++;
if ( i > 15 )
bWhile = FALSE;
}
else
bWhile = FALSE;
}
while ( bWhile );
while ( Application::Reschedule( true ) );
BOOL const ret = PostMessageW(GetSalData()->mpFirstInstance->mhComWnd, SAL_MSG_DUMMY, 0, 0);
SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!");
......
......@@ -5705,14 +5705,7 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
// messages in the message queue and dispatch them before we return control to the system.
if ( nRet )
{
MSG msg;
while( PeekMessage( &msg, nullptr, 0, 0, PM_REMOVE ) )
{
DispatchMessage( &msg );
}
}
while ( Application::Reschedule( true ) );
}
else
{
......
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