diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2006-04-06 14:42:33 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2006-04-06 14:42:33 +0000 |
commit | df156787d051ae3f1c6393a0e46fa0165f8d844a (patch) | |
tree | a1bd64778e39e26486dc7b2f8e2b385820a4e34f /vcl | |
parent | 972fcc578b29dac0bf092ef4bc7c7902fd9f66eb (diff) |
INTEGRATION: CWS vcl56 (1.6.210); FILE MERGED
2006/03/27 11:06:41 pl 1.6.210.2: #i60519# further refinement of timer handling
2006/03/23 18:50:09 pl 1.6.210.1: #i60519# let timers elapse during windows internal dispatch message loops
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/win/source/app/saltimer.cxx | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx index ab8bba59cd1d..033caf3ef619 100644 --- a/vcl/win/source/app/saltimer.cxx +++ b/vcl/win/source/app/saltimer.cxx @@ -4,9 +4,9 @@ * * $RCSfile: saltimer.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: obo $ $Date: 2006-03-24 13:49:29 $ + * last change: $Author: vg $ $Date: 2006-04-06 15:42:33 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -73,6 +73,7 @@ void ImplSalStartTimer( ULONG nMS, BOOL bMutex ) // Make a new timer with new period pSalData->mnTimerId = SetTimer( 0, 0, (UINT)nMS, SalTimerProc ); + pSalData->mnNextTimerTime = pSalData->mnLastEventTime + nMS; } // ----------------------------------------------------------------------- @@ -105,6 +106,7 @@ void WinSalTimer::Stop() { KillTimer( 0, pSalData->mnTimerId ); pSalData->mnTimerId = 0; + pSalData->mnNextTimerTime = 0; } } @@ -120,22 +122,25 @@ void CALLBACK SalTimerProc( HWND, UINT, UINT, DWORD ) // Test for MouseLeave SalTestMouseLeave(); - if ( pSVData->mpSalTimer ) + if ( pSVData->mpSalTimer && ! pSalData->mbInTimerProc ) { // Try to aquire the mutex. If we don't get the mutex then we // try this a short time later again. if ( ImplSalYieldMutexTryToAcquire() ) { - pSalData->mbInTimerProc = TRUE; - pSVData->mpSalTimer->CallCallback(); - pSalData->mbInTimerProc = FALSE; - ImplSalYieldMutexRelease(); - - // Run the timer in the correct time, if we start this - // with a small timeout, because we don't get the mutex - if ( pSalData->mnTimerId && - (pSalData->mnTimerMS != pSalData->mnTimerOrgMS) ) - ImplSalStartTimer( pSalData->mnTimerOrgMS, FALSE ); + if ( pSVData->mpSalTimer && ! pSalData->mbInTimerProc ) + { + pSalData->mbInTimerProc = TRUE; + pSVData->mpSalTimer->CallCallback(); + pSalData->mbInTimerProc = FALSE; + ImplSalYieldMutexRelease(); + + // Run the timer in the correct time, if we start this + // with a small timeout, because we don't get the mutex + if ( pSalData->mnTimerId && + (pSalData->mnTimerMS != pSalData->mnTimerOrgMS) ) + ImplSalStartTimer( pSalData->mnTimerOrgMS, FALSE ); + } } else ImplSalStartTimer( 10, TRUE ); |