diff options
author | culler <culler> | 2019-10-10 23:07:59 (GMT) |
---|---|---|
committer | culler <culler> | 2019-10-10 23:07:59 (GMT) |
commit | 38d9e5dd06e5431f02757936f1da6343fd3b1819 (patch) | |
tree | 93226304c88f4aaa1a2cfab2877d9d8371dc41b3 /macosx | |
parent | 88e3b36da872e4b80dff4e5b17bcaa40ed880c56 (diff) | |
parent | d77ce0839c97828ce9c6c3dcad68024f272b7a89 (diff) | |
download | tk-38d9e5dd06e5431f02757936f1da6343fd3b1819.zip tk-38d9e5dd06e5431f02757936f1da6343fd3b1819.tar.gz tk-38d9e5dd06e5431f02757936f1da6343fd3b1819.tar.bz2 |
Merge the remainder of catalina_more_tests
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXColor.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXNotify.c | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 015c164..80b368f 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -276,7 +276,7 @@ SetCGColorComponents( CGColorRef *c) { OSStatus err = noErr; - NSColor *bgColor, *color; + NSColor *bgColor, *color = nil; CGFloat rgba[4] = {0, 0, 0, 1}; #if MAC_OS_X_VERSION_MAX_ALLOWED < 101400 NSInteger colorVariant; @@ -340,7 +340,9 @@ SetCGColorComponents( break; case 2: if ([NSApp macMinorVersion] > 9) { +#if MAC_OS_X_VERSION_MAX_ALLOWED > 1090 color = [[NSColor labelColor] colorUsingColorSpace: deviceRGB]; +#endif } else { color = [[NSColor textColor] colorUsingColorSpace: deviceRGB]; } diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 7267b00..a4a87c6 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -288,6 +288,7 @@ TkMacOSXEventsSetupProc( ClientData clientData, int flags) { + static Bool havePeriodicEvents = NO; NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; /* @@ -310,7 +311,21 @@ TkMacOSXEventsSetupProc( if (currentEvent) { if (currentEvent.type > 0) { Tcl_SetMaxBlockTime(&zeroBlockTime); + if (havePeriodicEvents) { + [NSEvent stopPeriodicEvents]; + havePeriodicEvents = NO; + } } + } else if (!havePeriodicEvents){ + + /* + * When the user is not generating events we schedule a "hearbeat" + * event to fire every 0.1 seconds. This helps to make the vwait + * command more responsive when there is no user input. + */ + + havePeriodicEvents = YES; + [NSEvent startPeriodicEventsAfterDelay:0.0 withPeriod:0.1]; } } } |