diff options
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXInit.c | 13 | ||||
-rw-r--r-- | macosx/tkMacOSXPrivate.h | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 2 |
4 files changed, 23 insertions, 4 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index e03b5aa..c12c394 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -153,6 +153,19 @@ long tkMacOSXMacOSXVersion = 0; [NSApp setPoolLock:0]; /* + * Record the OS version we are running on. + */ + int minorVersion; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + Gestalt(gestaltSystemVersionMinor, (SInt32*)&minorVersion); +#else + NSOperatingSystemVersion systemVersion; + systemVersion = [[NSProcessInfo processInfo] operatingSystemVersion]; + minorVersion = systemVersion.minorVersion; +#endif + [NSApp setMacMinorVersion: minorVersion]; + + /* * Be our own delegate. */ [self setDelegate:self]; diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 796b4db..7337400 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -265,9 +265,11 @@ VISIBILITY_HIDDEN #ifdef __i386__ /* The Objective C runtime used on i386 requires this. */ int _poolLock; + int _macMinorVersion; #endif } @property int poolLock; +@property int macMinorVersion; @end @interface TKApplication(TKInit) @@ -344,7 +346,7 @@ VISIBILITY_HIDDEN @end @interface NSWindow(TKWm) -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1012 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400 - (NSPoint) convertPointToScreen:(NSPoint)point; - (NSPoint) convertPointFromScreen:(NSPoint)point; #endif diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 36fc297..379e4a6 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -930,10 +930,14 @@ ConfigureRestrictProc( * * Fortunately, Tk schedules all drawing to be done while Tcl is idle. * So we can do the drawing by processing all of the idle events that - * were created when the expose events were processed. + * were created when the expose events were processed. Unfortunately, + * doing this on 10.13 or earlier causes hangs when drawRect is called + * while Tcl is waiting for events or variable changes. */ - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} + if ([NSApp macMinorVersion] > 13 || [self inLiveResize]) { + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} + } } } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 9b76066..8bbaae0 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -212,7 +212,7 @@ static int windowHashInit = false; { return [self convertScreenToBase:point]; } -#elif MAC_OS_X_VERSION_MIN_REQUIRED < 1012 +#elif MAC_OS_X_VERSION_MIN_REQUIRED < 101400 - (NSPoint) convertPointToScreen: (NSPoint) point { NSRect pointrect; |