Tk Source Code

Check-in [5585c04b]
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 | core-8-6-branch
Files: files | file ages | folders
SHA1: 5585c04b3e01dbf1433d6289912bd8bfa09460ce
User & Date: kevin_walzer 2017-05-29 16:48:34
Context
2017-06-02
18:28
Fix [bc43fd20cf]: paneconfigure not working as expected check-in: 15c9e9c0 user: fvogel tags: core-8-6-branch
2017-05-31
20:17
Fix [bc43fd20cf]: paneconfigure not working as expected Closed-Leaf check-in: e11514a7 user: fvogel tags: bug-bc43fd20cf
20:15
merge mark check-in: 707912f8 user: fvogel tags: trunk
15:10
Attempt to fix [62f1343ad2]: Tk textbox not working with "Bengali" set as keyboard input language. Patch concept delevered by "budden", simplified a little bit, should have the same effect. (I would prefer to change the only remaining PeekMessageA() to PeekMessage(). But if the msg then doesn't contain sufficient information to decide upon, maybe we have to live with this ...) Leaf check-in: 807d983e user: jan.nijtmans tags: bug-62f1343ad2
2017-05-29
16:48
Fix for 5f44d4f5 in building Tk on macOS 10.6; thanks to Mojca Miklavec for patch check-in: 5585c04b user: kevin_walzer tags: core-8-6-branch
2017-05-23
10:45
Fix test-case font-44.1: It looks like XftPatternAddDouble(... XFT_PIXEL_SIZE ..) doesn't take scaling into account, so we have to do our own scaling. check-in: 8271b8d2 user: jan.nijtmans tags: core-8-6-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to macosx/tkMacOSXXStubs.c.

886
887
888
889
890
891
892
893


894
895
896
897
898
899
900
901
902

903
904
905
906
907
908
909
    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");







|
>
>





<



>







886
887
888
889
890
891
892
893
894
895
896
897
898
899
900

901
902
903
904
905
906
907
908
909
910
911
    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");