diff options
| author | Alan Third | 2017-07-06 23:10:49 +0100 |
|---|---|---|
| committer | Alan Third | 2017-08-16 20:56:55 +0100 |
| commit | 69f2b755f44a5e447b3ad482ce0b409764fa10e6 (patch) | |
| tree | 10765f8a1a48d03ed87f02321f0928e21c2567cf /src/nsmenu.m | |
| parent | 3505b77ad7b54e5208685b6e229c76387120d5a1 (diff) | |
| download | emacs-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/nsmenu.m')
| -rw-r--r-- | src/nsmenu.m | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m index 37a1a62d6d3..93e06707c07 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -532,9 +532,14 @@ x_activate_menubar (struct frame *f) | |||
| 532 | { | 532 | { |
| 533 | ++trackingMenu; | 533 | ++trackingMenu; |
| 534 | 534 | ||
| 535 | #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | 535 | #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 |
| 536 | // On 10.6 we get repeated calls, only the one for NSSystemDefined is "real". | 536 | // On 10.6 we get repeated calls, only the one for NSSystemDefined is "real". |
| 537 | if ([[NSApp currentEvent] type] != NSSystemDefined) return; | 537 | if ( |
| 538 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 | ||
| 539 | NSAppKitVersionNumber < NSAppKitVersionNumber10_7 && | ||
| 540 | #endif | ||
| 541 | [[NSApp currentEvent] type] != NSEventTypeSystemDefined) | ||
| 542 | return; | ||
| 538 | #endif | 543 | #endif |
| 539 | 544 | ||
| 540 | /* When dragging from one menu to another, we get willOpen followed by didClose, | 545 | /* When dragging from one menu to another, we get willOpen followed by didClose, |