summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorculler <culler>2020-08-25 15:23:08 (GMT)
committerculler <culler>2020-08-25 15:23:08 (GMT)
commita33411438ab9001bdd38f2d693229ec03b565c79 (patch)
tree82824fd71466852c2552f9e69579155526339359
parentb26dd4bffbf6100a480e0fd05d677bd7507a67b6 (diff)
parent8de1dd53e5559e54b3456769fd305f2ee0dd27a9 (diff)
downloadtk-a33411438ab9001bdd38f2d693229ec03b565c79.zip
tk-a33411438ab9001bdd38f2d693229ec03b565c79.tar.gz
tk-a33411438ab9001bdd38f2d693229ec03b565c79.tar.bz2
Merge 8.6
-rw-r--r--macosx/tkMacOSXBitmap.c4
-rw-r--r--macosx/tkMacOSXColor.c2
-rw-r--r--macosx/tkMacOSXConstants.h10
-rw-r--r--macosx/tkMacOSXFont.c3
4 files changed, 11 insertions, 8 deletions
diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c
index 213d925..29bb163 100644
--- a/macosx/tkMacOSXBitmap.c
+++ b/macosx/tkMacOSXBitmap.c
@@ -142,9 +142,7 @@ PixmapFromImage(
.tx = 0, .ty = size.height};
CGContextConcatCTM(dc.context, t);
[NSGraphicsContext saveGraphicsState];
- [NSGraphicsContext setCurrentContext:[NSGraphicsContext
- graphicsContextWithGraphicsPort:dc.context
- flipped:NO]];
+ [NSGraphicsContext setCurrentContext:GET_NSCONTEXT(dc.context, NO)];
[image drawAtPoint:NSZeroPoint fromRect:NSZeroRect
operation:NSCompositeCopy fraction:1.0];
[NSGraphicsContext restoreGraphicsState];
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index a1baff3..2c78b8d 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -315,7 +315,7 @@ GetRGBA(
break;
case semantic:
if (entry->index == controlAccentIndex && useFakeAccentColor) {
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 101500
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
color = [[NSColor colorForControlTint: [NSColor currentControlTint]]
colorUsingColorSpace:sRGB];
[color getComponents: rgba];
diff --git a/macosx/tkMacOSXConstants.h b/macosx/tkMacOSXConstants.h
index 19ffd2c..0b6ae2b 100644
--- a/macosx/tkMacOSXConstants.h
+++ b/macosx/tkMacOSXConstants.h
@@ -102,12 +102,18 @@ typedef NSInteger NSModalResponse;
#define NSStringPboardType NSPasteboardTypeString
#define NSOnState NSControlStateValueOn
#define NSOffState NSControlStateValueOff
-// Now we are also changing names of methods!
-#define graphicsContextWithGraphicsPort graphicsContextWithCGContext
#endif
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000
#define NSWindowStyleMaskTexturedBackground 0
#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
+#define GET_NSCONTEXT(context, flip) [NSGraphicsContext \
+ graphicsContextWithGraphicsPort:context flipped:flip]
+#else
+#define GET_NSCONTEXT(context, flip) [NSGraphicsContext \
+ graphicsContextWithCGContext:context flipped:NO]
+#endif
+
#endif
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index 4ad9118..5f83f5f 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -1218,8 +1218,7 @@ TkpDrawAngledCharsInContext(
[attributes setObject:(id)fg forKey:(id)kCTForegroundColorAttributeName];
CFRelease(fg);
nsFont = [attributes objectForKey:NSFontAttributeName];
- [nsFont setInContext:[NSGraphicsContext graphicsContextWithGraphicsPort:
- context flipped:NO]];
+ [nsFont setInContext:GET_NSCONTEXT(context, NO)];
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
attributedString = [[NSAttributedString alloc] initWithString:string
attributes:attributes];