diff options
author | culler <culler> | 2019-10-11 20:17:34 (GMT) |
---|---|---|
committer | culler <culler> | 2019-10-11 20:17:34 (GMT) |
commit | d9bc1a470a83fe3d030869bfc69c8bc21978ab78 (patch) | |
tree | dc50364ff874930db519f6c46190d9b3587284d0 /macosx | |
parent | b4d0e4d5f06727baef0cc4da45e4eb0e8a30af2a (diff) | |
parent | 09bb06b273610a411d611b606b08cb6b6b30eec7 (diff) | |
download | tk-d9bc1a470a83fe3d030869bfc69c8bc21978ab78.zip tk-d9bc1a470a83fe3d030869bfc69c8bc21978ab78.tar.gz tk-d9bc1a470a83fe3d030869bfc69c8bc21978ab78.tar.bz2 |
Use vwait instead of after in canvImg.test. On macOS protect against exceptions when periodic events are scheduled.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXNotify.c | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index e21034e..5b8793c 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -58,6 +58,7 @@ enum { NSTrackingArea *trackingArea = nil; NSInteger eventNumber, clickCount, buttonNumber; #endif + [NSEvent stopPeriodicEvents]; #ifdef TK_MAC_DEBUG_EVENTS TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); @@ -660,6 +661,7 @@ TkpSetCapture( while (winPtr && !Tk_IsTopLevel(winPtr)) { winPtr = winPtr->parentPtr; } + [NSEvent stopPeriodicEvents]; captureWinPtr = (Tk_Window) winPtr; } diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index e554693..098fe4c 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -311,17 +311,16 @@ TkMacOSXEventsSetupProc( if (currentEvent) { if (currentEvent.type > 0) { Tcl_SetMaxBlockTime(&zeroBlockTime); - if (havePeriodicEvents) { - [NSEvent stopPeriodicEvents]; - havePeriodicEvents = NO; - } + [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. + * command more responsive when there is no user input, e.g. when + * running the test suite. */ havePeriodicEvents = YES; |