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