[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 95e7195 1/2: Silence macOS 10.13 deprecation notice
From: |
Alan Third |
Subject: |
[Emacs-diffs] master 95e7195 1/2: Silence macOS 10.13 deprecation notices (Bug#29643) |
Date: |
Sat, 16 Dec 2017 12:05:51 -0500 (EST) |
branch: master
commit 95e7195f0d2a30beb2aaa0c324dd6049a168ba5b
Author: Alan Third <address@hidden>
Commit: Alan Third <address@hidden>
Silence macOS 10.13 deprecation notices (Bug#29643)
* src/nsfns.m (Fx_display_backing_store):
(Fx_display_save_under): Don't use NSBackingStoreRetained or
NSBackingStoreNonretained on macOS 10.13+.
* src/nsselect.m (symbol_to_nsstring):
(ns_string_to_symbol):
(nxatoms_of_nsselect): Replace NSGeneralPboard with
NSPasteboardNameGeneral.
* src/nsterm.h: #define NSPasteboardNameGeneral to NSGeneralPboard on
GNUstep and macOS < 10.13.
* src/nsterm.m (EmacsView::resetCursorRects):
(EmacsScroller::resetCursorRects): Don't use setOnMouseEntered on
macOS 10.13+.
---
src/nsfns.m | 4 ++++
src/nsselect.m | 8 ++++----
src/nsterm.h | 5 +++++
src/nsterm.m | 17 +++++++++++++++--
4 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/src/nsfns.m b/src/nsfns.m
index 8172268..064b476 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1896,10 +1896,12 @@ If omitted or nil, that stands for the selected frame's
display. */)
{
case NSBackingStoreBuffered:
return intern ("buffered");
+#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 101300
case NSBackingStoreRetained:
return intern ("retained");
case NSBackingStoreNonretained:
return intern ("non-retained");
+#endif
default:
error ("Strange value for backingType parameter of frame");
}
@@ -1953,9 +1955,11 @@ If omitted or nil, that stands for the selected frame's
display. */)
case NSBackingStoreBuffered:
return Qt;
+#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 101300
case NSBackingStoreRetained:
case NSBackingStoreNonretained:
return Qnil;
+#endif
default:
error ("Strange value for backingType parameter of frame");
diff --git a/src/nsselect.m b/src/nsselect.m
index 067c778..d1ce943 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -36,7 +36,7 @@ GNUstep port and post-20 update by Adrian Robert
(address@hidden)
static Lisp_Object Vselection_alist;
-/* NSGeneralPboard is pretty much analogous to X11 CLIPBOARD */
+/* NSPasteboardNameGeneral is pretty much analogous to X11 CLIPBOARD */
static NSString *NXPrimaryPboard;
static NSString *NXSecondaryPboard;
@@ -54,7 +54,7 @@ static NSString *
symbol_to_nsstring (Lisp_Object sym)
{
CHECK_SYMBOL (sym);
- if (EQ (sym, QCLIPBOARD)) return NSGeneralPboard;
+ if (EQ (sym, QCLIPBOARD)) return NSPasteboardNameGeneral;
if (EQ (sym, QPRIMARY)) return NXPrimaryPboard;
if (EQ (sym, QSECONDARY)) return NXSecondaryPboard;
if (EQ (sym, QTEXT)) return NSStringPboardType;
@@ -70,7 +70,7 @@ ns_symbol_to_pb (Lisp_Object symbol)
static Lisp_Object
ns_string_to_symbol (NSString *t)
{
- if ([t isEqualToString: NSGeneralPboard])
+ if ([t isEqualToString: NSPasteboardNameGeneral])
return QCLIPBOARD;
if ([t isEqualToString: NXPrimaryPboard])
return QPRIMARY;
@@ -469,7 +469,7 @@ nxatoms_of_nsselect (void)
pasteboard_changecount
= [[NSMutableDictionary
dictionaryWithObjectsAndKeys:
- [NSNumber numberWithLong:0], NSGeneralPboard,
+ [NSNumber numberWithLong:0], NSPasteboardNameGeneral,
[NSNumber numberWithLong:0], NXPrimaryPboard,
[NSNumber numberWithLong:0], NXSecondaryPboard,
[NSNumber numberWithLong:0], NSStringPboardType,
diff --git a/src/nsterm.h b/src/nsterm.h
index c81bf5f..e669c95 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1322,5 +1322,10 @@ enum NSWindowTabbingMode
NSWindowTabbingModePreferred,
NSWindowTabbingModeDisallowed
};
+#endif /* !defined (NS_IMPL_COCOA) || !defined (MAC_OS_X_VERSION_10_12) */
+
+#if !defined (NS_IMPL_COCOA) || !defined (MAC_OS_X_VERSION_10_13)
+/* Deprecated in macOS 10.13. */
+#define NSPasteboardNameGeneral NSGeneralPboard
#endif
#endif /* HAVE_NS */
diff --git a/src/nsterm.m b/src/nsterm.m
index 50e06c9..07ac8f9 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6016,7 +6016,13 @@ not_in_argv (NSString *arg)
if (!NSIsEmptyRect (visible))
[self addCursorRect: visible cursor: currentCursor];
- [currentCursor setOnMouseEntered: YES];
+
+#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 101300
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
+ if ([currentCursor respondsToSelector: @selector(setOnMouseEntered)])
+#endif
+ [currentCursor setOnMouseEntered: YES];
+#endif
}
@@ -8746,7 +8752,14 @@ not_in_argv (NSString *arg)
if (!NSIsEmptyRect (visible))
[self addCursorRect: visible cursor: [NSCursor arrowCursor]];
- [[NSCursor arrowCursor] setOnMouseEntered: YES];
+
+#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 101300
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
+ if ([[NSCursor arrowCursor] respondsToSelector:
+ @selector(setOnMouseEntered)])
+#endif
+ [[NSCursor arrowCursor] setOnMouseEntered: YES];
+#endif
}