summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--macosx/tkMacOSXImage.c10
-rw-r--r--macosx/tkMacOSXWm.c37
-rw-r--r--macosx/tkMacOSXXStubs.c2
3 files changed, 22 insertions, 27 deletions
diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c
index d08accc..d0c1945 100644
--- a/macosx/tkMacOSXImage.c
+++ b/macosx/tkMacOSXImage.c
@@ -160,14 +160,14 @@ XGetImage(
char R, G, B, A;
unsigned int scalefactor=1, scaled_height=height, scaled_width=width;
NSWindow *win = TkMacOSXDrawableWindow(drawable);
- static enum {unknown, no, yes} supports_retina = unknown;
+ static enum {unknown, no, yes} has_retina = unknown;
- if (win && supports_retina == unknown) {
- supports_retina = [win respondsToSelector:
- @selector(backingScaleFactor)]? yes: no;
+ if (win && has_retina == unknown) {
+ has_retina = [win respondsToSelector:@selector(backingScaleFactor)]?
+ yes : no;
}
- if (supports_retina == yes) {
+ if (has_retina == yes) {
/*
* We only allow scale factors 1 or 2, as Apple currently does.
*/
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index c7fc6ce..e9b38b5 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -198,7 +198,6 @@ static Tcl_HashTable windowTable;
static int windowHashInit = false;
-
#pragma mark NSWindow(TKWm)
/*
@@ -215,7 +214,6 @@ static int windowHashInit = false;
{
return [self convertScreenToBase:point];
}
-@end
#else
- (NSPoint) convertPointToScreen: (NSPoint) point
{
@@ -235,26 +233,8 @@ static int windowHashInit = false;
}
#endif
-/*Override automatic fullscreen button on 10.13 because system fullscreen API
-confuses Tk window geometry.
-*/
-#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_12
-- (void)toggleFullScreen:(id)sender
-{
- TkWindow *winPtr = TkMacOSXGetTkWindow(self);
- Tk_Window win_Ptr=(Tk_Window) winPtr;
- Tcl_Interp *interp = Tk_Interp(win_Ptr);
- if ([self isZoomed]) {
- TkMacOSXZoomToplevel(self, inZoomIn);
- } else {
- TkMacOSXZoomToplevel(self, inZoomOut);
- }
-}
-
-#endif
@end
-
#pragma mark -
@@ -402,7 +382,22 @@ static void RemapWindows(TkWindow *winPtr,
}
@end
-@implementation TKWindow
+
+@implementation TKWindow: NSWindow
+#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_12
+/*
+ * Override automatic fullscreen button on >10.12 because system fullscreen API
+ * confuses Tk window geometry.
+ */
+- (void)toggleFullScreen:(id)sender
+{
+ if ([self isZoomed]) {
+ TkMacOSXZoomToplevel(self, inZoomIn);
+ } else {
+ TkMacOSXZoomToplevel(self, inZoomOut);
+ }
+}
+#endif
@end
@implementation TKWindow(TKWm)
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index 4197266..c7ff58d 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -175,7 +175,7 @@ TkpOpenDisplay(
{
int major, minor, patch;
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 10100
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080
Gestalt(gestaltSystemVersionMajor, (SInt32*)&major);
Gestalt(gestaltSystemVersionMinor, (SInt32*)&minor);
Gestalt(gestaltSystemVersionBugFix, (SInt32*)&patch);