summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2017-05-29 16:50:02 (GMT)
committerKevin Walzer <kw@codebykevin.com>2017-05-29 16:50:02 (GMT)
commit25d536cfb12de418f7be438d72122defb588aa18 (patch)
treebfe2146f3205a6d83828fbf1aa3763d730bbdcdd /macosx
parent936425eee091070d4fa71676f00ce0105f093f03 (diff)
downloadtk-25d536cfb12de418f7be438d72122defb588aa18.zip
tk-25d536cfb12de418f7be438d72122defb588aa18.tar.gz
tk-25d536cfb12de418f7be438d72122defb588aa18.tar.bz2
Fix for 5f44d4f5 in building Tk on macOS 10.6; thanks to Mojca Miklavec for patch
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXXStubs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index 2251b8f..004ac1b 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -882,16 +882,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;