void ImplNSAppPostEvent( short nEventId, BOOL bAtStart, int nUserData )
{
ReleasePoolHolder aPool;
NSEvent* pEvent = [NSEvent otherEventWithType: NSEventTypeApplicationDefined
location: NSZeroPoint
modifierFlags: 0
timestamp: [[NSProcessInfo processInfo] systemUptime]
windowNumber: 0
context: nil
subtype: nEventId
data1: nUserData
data2: 0];
assert( pEvent ); if ( nil == pEvent ) return; if ( NO == bAtStart )
{ // nextEventMatchingMask has to run in the main thread!
assert([NSThread isMainThread]);
// Posting an event to the end of an empty queue fails, // so we peek the queue and post to the start, if empty. // Some Qt bugs even indicate nextEvent without dequeue // sometimes blocks, so we dequeue and re-add the event.
NSEvent* pPeekEvent = [NSApp nextEventMatchingMask: NSEventMaskAny
untilDate: nil
inMode: NSDefaultRunLoopMode
dequeue: YES]; if ( nil == pPeekEvent )
bAtStart = YES; else
[NSApp postEvent: pPeekEvent atStart: YES];
}
[NSApp postEvent: pEvent atStart: bAtStart];
}
void AquaSalTimer::handleTimerElapsed()
{ // tdf#164564 don't stop the timer while waiting for a native event // If only ImplGetSVData()->mpWinData->mbIsWaitingForNativeEvent is // true, stopping the timer will also stop animation when using // Skia/Raster or Skia is disabled. if ( m_bDirectTimeout || ImplGetSVData()->mpWinData->mbIsLiveResize )
{ // Stop the timer, as it is just invalidated after the firing function
Stop();
callTimerCallback();
} else
queueDispatchTimerEvent( true );
}
void AquaSalTimer::handleWindowShouldClose()
{ // for whatever reason events get filtered on close, presumably by // timestamp so post a new timeout event, if there was one queued... if ( ExistsValidEvent() && !m_pRunningTimer )
queueDispatchTimerEvent( false );
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.