Tk Source Code

Check-in [fa61f24c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix for 5f44d4f5 in building Tk on macOS 10.6; thanks to Mojca Miklavec for patch
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fa61f24c161f44223b5fd60f1580c5cdd860995f
User & Date: kevin_walzer 2017-05-29 16:50:02
Context
2017-05-31
12:27
Sync with Tcl. check-in: da99f45f user: stu tags: trunk
2017-05-29
16:50
Fix for 5f44d4f5 in building Tk on macOS 10.6; thanks to Mojca Miklavec for patch check-in: fa61f24c user: kevin_walzer tags: trunk
2017-05-23
10:46
merge core-8-6-branch check-in: 3b2405df user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXXStubs.c.

878
879
880
881
882
883
884
885


886
887
888
889
890
891
892
893
894

895
896
897
898
899
900
901
    char *           bitmap = NULL;
    char *           image_data=NULL;
    int	        depth = 32;
    int	        offset = 0;
    int	        bitmap_pad = 0;
    int	        bytes_per_row = 4*width;
    int                size;
    MacDrawable *macDraw = (MacDrawable *) d;


    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;
    }

    int scaled_height = height * scalefactor;
    int scaled_width = width * scalefactor;

    if (format == ZPixmap) {
	if (width == 0 || height == 0) {
	    /* This happens all the time.
	    TkMacOSXDbgMsg("XGetImage: empty image requested");







|
>
>





<



>







878
879
880
881
882
883
884
885
886
887
888
889
890
891
892

893
894
895
896
897
898
899
900
901
902
903
    char *           bitmap = NULL;
    char *           image_data=NULL;
    int	        depth = 32;
    int	        offset = 0;
    int	        bitmap_pad = 0;
    int	        bytes_per_row = 4*width;
    int                size;
    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.
     */

    if (win && [win respondsToSelector:@selector(backingScaleFactor)]) {
	scalefactor = ([win backingScaleFactor] == 2.0) ? 2 : 1;
    }
#endif
    int scaled_height = height * scalefactor;
    int scaled_width = width * scalefactor;

    if (format == ZPixmap) {
	if (width == 0 || height == 0) {
	    /* This happens all the time.
	    TkMacOSXDbgMsg("XGetImage: empty image requested");