summaryrefslogtreecommitdiff
path: root/src/macfont.m
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2017-07-06 23:10:49 +0100
committerAlan Third <alan@idiocy.org>2017-08-16 20:56:55 +0100
commit69f2b755f44a5e447b3ad482ce0b409764fa10e6 (patch)
tree10765f8a1a48d03ed87f02321f0928e21c2567cf /src/macfont.m
parent3505b77ad7b54e5208685b6e229c76387120d5a1 (diff)
downloademacs-69f2b755f44a5e447b3ad482ce0b409764fa10e6.tar.gz
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,
and synthetic bold looks thinner on such environments.
Apple says there are no plans to address this issue
(rdar://11644870) currently. So we add a workaround. */
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- CGContextSetLineWidth (context, synthetic_bold_factor * font_size
- * [[FRAME_NS_VIEW(f) window] backingScaleFactor]);
-#else
- CGContextSetLineWidth (context, synthetic_bold_factor * font_size);
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+ if ([[FRAME_NS_VIEW(f) window] respondsToSelector:
+ @selector(backingScaleFactor)])
+#endif
+ CGContextSetLineWidth (context, synthetic_bold_factor * font_size
+ * [[FRAME_NS_VIEW(f) window] backingScaleFactor]);
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+ else
+#endif
+#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+ CGContextSetLineWidth (context, synthetic_bold_factor * font_size);
#endif
CG_SET_STROKE_COLOR_WITH_FACE_FOREGROUND (context, face, f);
}