summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2017-05-29 16:48:34 (GMT)
committerKevin Walzer <kw@codebykevin.com>2017-05-29 16:48:34 (GMT)
commitb94f5639e0d02222c409549af8dc464260afbfe6 (patch)
tree764d3d05ddda3090e791e0359a895bc31183d4fc
parentce84448c05bb61135f0cebd1a812f3e4496f62bd (diff)
downloadtk-b94f5639e0d02222c409549af8dc464260afbfe6.zip
tk-b94f5639e0d02222c409549af8dc464260afbfe6.tar.gz
tk-b94f5639e0d02222c409549af8dc464260afbfe6.tar.bz2
Fix for 5f44d4f5 in building Tk on macOS 10.6; thanks to Mojca Miklavec for patch
-rw-r--r--macosx/tkMacOSXXStubs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index 8d9820b..1c2d908 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -890,16 +890,18 @@ XGetImage(
int bitmap_pad = 0;
int bytes_per_row = 4*width;
int size;
- MacDrawable *macDraw = (MacDrawable *) d;
+ MacDrawable *macDraw = (MacDrawable *) d; // Where is this variable used? May it be removed?
+ int scalefactor = 1;
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
NSWindow *win = TkMacOSXDrawableWindow(d);
/* This code assumes that backing scale factors are integers. Currently
* Retina displays use a scale factor of 2.0 and normal displays use 1.0.
* We do not support any other values here.
*/
- int scalefactor = 1;
if (win && [win respondsToSelector:@selector(backingScaleFactor)]) {
scalefactor = ([win backingScaleFactor] == 2.0) ? 2 : 1;
}
+#endif
int scaled_height = height * scalefactor;
int scaled_width = width * scalefactor;