summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-09-27 14:44:56 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-09-27 14:53:35 +0200
commit155795b9c129584febd9771014078adb6fe25932 (patch)
treee644789b14fce8db926cf8e4a64510b652bbd7ad
parent3d3643491c9b3af082103bbd6bd18994d24cc568 (diff)
tdf#112288 compare event timestamp with sys uptime
This is a "brown paperbag" fixup. untilDate is actually used as a timeout for nextEventMatchingMask, not as a maximum event age. So manually compare the event timestamp with the system uptime. Change-Id: I912bedc0cba45c5cc231679c1b6139fa012492ed
-rw-r--r--vcl/osx/salinst.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index f55e9b4aa297..855dac645e41 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -589,7 +589,7 @@ bool AquaSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
{
// handle available events
NSEvent* pEvent = nil;
- NSDate *now = [[NSDate alloc] init];
+ NSTimeInterval now = [[NSProcessInfo processInfo]systemUptime];
do
{
SolarMutexReleaser aReleaser;
@@ -598,7 +598,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
// 'NSAnyEventMask' is deprecated: first deprecated in macOS 10.12
pEvent = [NSApp nextEventMatchingMask: NSAnyEventMask
SAL_WNODEPRECATED_DECLARATIONS_POP
- untilDate: now
+ untilDate: nil
inMode: NSDefaultRunLoopMode
dequeue: YES];
if( pEvent )
@@ -611,7 +611,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
[NSApp updateWindows];
- if ( !bHandleAllCurrentEvents || !pEvent )
+ if ( !bHandleAllCurrentEvents || !pEvent || now < [pEvent timestamp] )
break;
}
while( true );
@@ -744,7 +744,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
if( nType & VclInputFlags::KEYBOARD)
nEventMask |= NSKeyDownMask | NSKeyUpMask | NSFlagsChangedMask;
if( nType & VclInputFlags::OTHER)
- nEventMask |= NSTabletPoint;
+ nEventMask |= NSTabletPoint | NSApplicationDefinedMask;
SAL_WNODEPRECATED_DECLARATIONS_POP
// TODO: VclInputFlags::PAINT / more VclInputFlags::OTHER
if( !bool(nType) )