aboutsummaryrefslogtreecommitdiffstats
path: root/src/macfont.m
diff options
context:
space:
mode:
authorAlan Third2017-07-06 23:10:49 +0100
committerAlan Third2017-08-16 20:56:55 +0100
commit69f2b755f44a5e447b3ad482ce0b409764fa10e6 (patch)
tree10765f8a1a48d03ed87f02321f0928e21c2567cf /src/macfont.m
parent3505b77ad7b54e5208685b6e229c76387120d5a1 (diff)
downloademacs-69f2b755f44a5e447b3ad482ce0b409764fa10e6.tar.gz
emacs-69f2b755f44a5e447b3ad482ce0b409764fa10e6.zip
Allow use of run-time OS version checks on macOS (bug#27810)
* src/nsterm.h (NSWindowTabbingMode): Define in pre-Sierra macOS. (MAC_OS_X_VERSION_10_6, MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8, MAC_OS_X_VERSION_10_9, MAC_OS_X_VERSION_10_12, HAVE_NATIVE_FS): Remove defines. (NSWindowStyleMaskFullScreen, NSWindowCollectionBehaviorFullScreenPrimary, NSApplicationPresentationFullScreen, NSApplicationPresentationAutoHideToolbar): Define in macOS 10.6. * src/nsterm.m (colorForEmacsRed, colorUsingDefaultColorSpace, check_native_fs, ns_read_socket, ns_select, runAlertPanel, initFrameFromEmacs, windowDidMiniaturize, windowDidEnterFullScreen, windowDidExitFullScreen, isFullscreen, updateCollectionBehavior, toggleFullScreen, constrainFrameRect, scrollerWidth, syms_of_nsterm): Allow use of run-time checks and replace version check macros. * src/nsfns.m (ns_screen_name): Use run-time OS version checks. * src/macfont.m (macfont_draw): Use run-time OS version checks. * src/nsmenu.m (menuWillOpen): Use run-time OS version checks. Co-authored-by: Charles A. Roelli <charles@aurox.ch>
Diffstat (limited to 'src/macfont.m')
-rw-r--r--src/macfont.m18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/macfont.m b/src/macfont.m
index 4d310e47aec..19145f92c0a 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -2869,11 +2869,19 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y,
2869 and synthetic bold looks thinner on such environments. 2869 and synthetic bold looks thinner on such environments.
2870 Apple says there are no plans to address this issue 2870 Apple says there are no plans to address this issue
2871 (rdar://11644870) currently. So we add a workaround. */ 2871 (rdar://11644870) currently. So we add a workaround. */
2872#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 2872#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
2873 CGContextSetLineWidth (context, synthetic_bold_factor * font_size 2873#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
2874 * [[FRAME_NS_VIEW(f) window] backingScaleFactor]); 2874 if ([[FRAME_NS_VIEW(f) window] respondsToSelector:
2875#else 2875 @selector(backingScaleFactor)])
2876 CGContextSetLineWidth (context, synthetic_bold_factor * font_size); 2876#endif
2877 CGContextSetLineWidth (context, synthetic_bold_factor * font_size
2878 * [[FRAME_NS_VIEW(f) window] backingScaleFactor]);
2879#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
2880 else
2881#endif
2882#endif
2883#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
2884 CGContextSetLineWidth (context, synthetic_bold_factor * font_size);
2877#endif 2885#endif
2878 CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND (context, face, f); 2886 CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND (context, face, f);
2879 } 2887 }