Ticket #52090: patch-macosx-tkMacOSXXStubs_non-Retina.diff

File patch-macosx-tkMacOSXXStubs_non-Retina.diff, 1.0 KB (added by ballapete (Peter "Pete" Dyballa), 8 years ago)

Patch to make tk @8.6.6_0+quartz build on Non-Retina Snow Leopard

  • macosx/tkMacOSXXStubs.c

    old new  
    890890    int         bitmap_pad = 0;
    891891    int         bytes_per_row = 4*width;
    892892    int                size;
     893#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
    893894    MacDrawable *macDraw = (MacDrawable *) d;
    894895    NSWindow *win = TkMacOSXDrawableWindow(d);
    895896    /* This code assumes that backing scale factors are integers.  Currently
    896897     * Retina displays use a scale factor of 2.0 and normal displays use 1.0.
    897898     * We do not support any other values here.
    898899     */
     900#endif
    899901    int scalefactor = 1;
     902#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
    900903    if (win && [win respondsToSelector:@selector(backingScaleFactor)]) {
    901904        scalefactor = ([win backingScaleFactor] == 2.0) ? 2 : 1;
    902905    }
     906#endif
    903907    int scaled_height = height * scalefactor;
    904908    int scaled_width = width * scalefactor;
    905 
    906909    if (format == ZPixmap) {
    907910        if (width == 0 || height == 0) {
    908911            /* This happens all the time.