summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXInit.c
diff options
context:
space:
mode:
authorculler <culler>2018-10-21 22:53:22 (GMT)
committerculler <culler>2018-10-21 22:53:22 (GMT)
commitcbe1934ea6df107ca09461c85ca4a85975d492e8 (patch)
treec4a76ca22926a5a1b883b8f1905f921386ee347c /macosx/tkMacOSXInit.c
parent8ea711d0aea88cecedd9fe9f32436e376da780ee (diff)
downloadtk-cbe1934ea6df107ca09461c85ca4a85975d492e8.zip
tk-cbe1934ea6df107ca09461c85ca4a85975d492e8.tar.gz
tk-cbe1934ea6df107ca09461c85ca4a85975d492e8.tar.bz2
Add a runtime check for the OS version, to decide whether to process idle events in drawRect.
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r--macosx/tkMacOSXInit.c13
1 files changed, 13 insertions, 0 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];