[Libreoffice-commits] core.git: vcl/osx

Jan-Marek Glogowski glogow at fbihome.de
Wed Sep 27 12:55:05 UTC 2017


 vcl/osx/salinst.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 155795b9c129584febd9771014078adb6fe25932
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date:   Wed Sep 27 14:44:56 2017 +0200

    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

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) )


More information about the Libreoffice-commits mailing list