Ticket #43283: patch-backingScaleFactor.diff

File patch-backingScaleFactor.diff, 935 bytes (added by devernay (Frédéric Devernay), 10 years ago)

patchfile

  • gtk/gtkapplication-quartz-menu.c

    old new  
    3030
    3131#import <Cocoa/Cocoa.h>
    3232
     33#if !defined(MAC_OS_X_VERSION_10_7) || \
     34MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
     35
     36@interface NSScreen (LionAPI)
     37- (CGFloat)backingScaleFactor;
     38- (NSRect)convertRectToBacking:(NSRect)aRect;
     39@end
     40
     41#endif // 10.7
     42
    3343#define ICON_SIZE 16
    3444
    3545#define BLACK               "#000000"
     
    262272        }
    263273
    264274      theme = gtk_icon_theme_get_default ();
    265       scale = roundf ([[NSScreen mainScreen] backingScaleFactor]);
     275      scale = [[NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)] ? roundf ([[NSScreen mainScreen] backingScaleFactor]) : 1.;
    266276      info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, icon, ICON_SIZE, scale, GTK_ICON_LOOKUP_USE_BUILTIN);
    267277
    268278      if (info != NULL)