summaryrefslogtreecommitdiff
path: root/vcl/osx/saltimer.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-10-18 17:00:53 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-10-20 14:51:04 +0200
commitfd5fa397a0a46470e034bb23789f7a17592cb070 (patch)
treeaad757bdeb1da0ae9334da2b383c17e302e98582 /vcl/osx/saltimer.cxx
parent1da252d58bc3d01ee2a26b03ed6666723d82833d (diff)
OSX implement direct timeout processing
Basically works in the same way then in the Windows backend. Change-Id: If48e2b55f037563839a5e716830ce75ed78381e4 Reviewed-on: https://gerrit.libreoffice.org/43530 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/osx/saltimer.cxx')
-rw-r--r--vcl/osx/saltimer.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/vcl/osx/saltimer.cxx b/vcl/osx/saltimer.cxx
index 34d46f08728a..3d74da42a3dc 100644
--- a/vcl/osx/saltimer.cxx
+++ b/vcl/osx/saltimer.cxx
@@ -74,6 +74,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
void AquaSalTimer::queueDispatchTimerEvent( bool bAtStart )
{
Stop();
+ m_bDirectTimeout = true;
ImplNSAppPostEvent( AquaSalInstance::DispatchTimerEvent,
bAtStart, GetNextEventVersion() );
}
@@ -88,8 +89,9 @@ void AquaSalTimer::Start( sal_uLong nMS )
return;
}
- if ( 0 == nMS && !pSalData->mpInstance->mbIsLiveResize )
- queueDispatchTimerEvent( NO );
+ m_bDirectTimeout = (0 == nMS) && !pSalData->mpInstance->mbIsLiveResize;
+ if ( m_bDirectTimeout )
+ Stop();
else
{
NSTimeInterval aTI = double(nMS) / 1000.0;
@@ -139,13 +141,14 @@ void AquaSalTimer::callTimerCallback()
{
ImplSVData* pSVData = ImplGetSVData();
SolarMutexGuard aGuard;
+ m_bDirectTimeout = false;
if( pSVData->maSchedCtx.mpSalTimer )
pSVData->maSchedCtx.mpSalTimer->CallCallback();
}
void AquaSalTimer::handleTimerElapsed()
{
- if ( GetSalData()->mpInstance->mbIsLiveResize )
+ if ( m_bDirectTimeout || GetSalData()->mpInstance->mbIsLiveResize )
{
// Stop the timer, as it is just invalidated after the firing function
Stop();
@@ -155,10 +158,12 @@ void AquaSalTimer::handleTimerElapsed()
queueDispatchTimerEvent( YES );
}
-void AquaSalTimer::handleDispatchTimerEvent( NSEvent *pEvent )
+bool AquaSalTimer::handleDispatchTimerEvent( NSEvent *pEvent )
{
- if ( IsValidEventVersion( [pEvent data1] ) )
+ bool bIsValidEvent = IsValidEventVersion( [pEvent data1] );
+ if ( bIsValidEvent )
callTimerCallback();
+ return bIsValidEvent;
}
void AquaSalTimer::handleStartTimerEvent( NSEvent* pEvent )
@@ -177,8 +182,8 @@ void AquaSalTimer::handleStartTimerEvent( NSEvent* pEvent )
bool AquaSalTimer::IsTimerElapsed() const
{
- assert( !(ExistsValidEvent() && m_pRunningTimer) );
- if ( ExistsValidEvent() )
+ assert( !((ExistsValidEvent() || m_bDirectTimeout) && m_pRunningTimer) );
+ if ( ExistsValidEvent() || m_bDirectTimeout )
return true;
if ( !m_pRunningTimer )
return false;