aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Third2017-12-10 20:15:52 +0000
committerAlan Third2017-12-16 16:35:46 +0000
commit95e7195f0d2a30beb2aaa0c324dd6049a168ba5b (patch)
tree1a914601410a688511b1112cb16f18fda575d7a0 /src
parentf63d9f86b5688ac84ec6e7eecdbb6cac103dbcf2 (diff)
downloademacs-95e7195f0d2a30beb2aaa0c324dd6049a168ba5b.tar.gz
emacs-95e7195f0d2a30beb2aaa0c324dd6049a168ba5b.zip
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+.
Diffstat (limited to 'src')
-rw-r--r--src/nsfns.m4
-rw-r--r--src/nsselect.m8
-rw-r--r--src/nsterm.h5
-rw-r--r--src/nsterm.m17
4 files changed, 28 insertions, 6 deletions
diff --git a/src/nsfns.m b/src/nsfns.m
index 81722681674..064b476fb4e 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. */)
1896 { 1896 {
1897 case NSBackingStoreBuffered: 1897 case NSBackingStoreBuffered:
1898 return intern ("buffered"); 1898 return intern ("buffered");
1899#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 101300
1899 case NSBackingStoreRetained: 1900 case NSBackingStoreRetained:
1900 return intern ("retained"); 1901 return intern ("retained");
1901 case NSBackingStoreNonretained: 1902 case NSBackingStoreNonretained:
1902 return intern ("non-retained"); 1903 return intern ("non-retained");
1904#endif
1903 default: 1905 default:
1904 error ("Strange value for backingType parameter of frame"); 1906 error ("Strange value for backingType parameter of frame");
1905 } 1907 }
@@ -1953,9 +1955,11 @@ If omitted or nil, that stands for the selected frame's display. */)
1953 case NSBackingStoreBuffered: 1955 case NSBackingStoreBuffered:
1954 return Qt; 1956 return Qt;
1955 1957
1958#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 101300
1956 case NSBackingStoreRetained: 1959 case NSBackingStoreRetained:
1957 case NSBackingStoreNonretained: 1960 case NSBackingStoreNonretained:
1958 return Qnil; 1961 return Qnil;
1962#endif
1959 1963
1960 default: 1964 default:
1961 error ("Strange value for backingType parameter of frame"); 1965 error ("Strange value for backingType parameter of frame");
diff --git a/src/nsselect.m b/src/nsselect.m
index 067c7788e8b..d1ce9437a73 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -36,7 +36,7 @@ GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
36 36
37static Lisp_Object Vselection_alist; 37static Lisp_Object Vselection_alist;
38 38
39/* NSGeneralPboard is pretty much analogous to X11 CLIPBOARD */ 39/* NSPasteboardNameGeneral is pretty much analogous to X11 CLIPBOARD */
40static NSString *NXPrimaryPboard; 40static NSString *NXPrimaryPboard;
41static NSString *NXSecondaryPboard; 41static NSString *NXSecondaryPboard;
42 42
@@ -54,7 +54,7 @@ static NSString *
54symbol_to_nsstring (Lisp_Object sym) 54symbol_to_nsstring (Lisp_Object sym)
55{ 55{
56 CHECK_SYMBOL (sym); 56 CHECK_SYMBOL (sym);
57 if (EQ (sym, QCLIPBOARD)) return NSGeneralPboard; 57 if (EQ (sym, QCLIPBOARD)) return NSPasteboardNameGeneral;
58 if (EQ (sym, QPRIMARY)) return NXPrimaryPboard; 58 if (EQ (sym, QPRIMARY)) return NXPrimaryPboard;
59 if (EQ (sym, QSECONDARY)) return NXSecondaryPboard; 59 if (EQ (sym, QSECONDARY)) return NXSecondaryPboard;
60 if (EQ (sym, QTEXT)) return NSStringPboardType; 60 if (EQ (sym, QTEXT)) return NSStringPboardType;
@@ -70,7 +70,7 @@ ns_symbol_to_pb (Lisp_Object symbol)
70static Lisp_Object 70static Lisp_Object
71ns_string_to_symbol (NSString *t) 71ns_string_to_symbol (NSString *t)
72{ 72{
73 if ([t isEqualToString: NSGeneralPboard]) 73 if ([t isEqualToString: NSPasteboardNameGeneral])
74 return QCLIPBOARD; 74 return QCLIPBOARD;
75 if ([t isEqualToString: NXPrimaryPboard]) 75 if ([t isEqualToString: NXPrimaryPboard])
76 return QPRIMARY; 76 return QPRIMARY;
@@ -469,7 +469,7 @@ nxatoms_of_nsselect (void)
469 pasteboard_changecount 469 pasteboard_changecount
470 = [[NSMutableDictionary 470 = [[NSMutableDictionary
471 dictionaryWithObjectsAndKeys: 471 dictionaryWithObjectsAndKeys:
472 [NSNumber numberWithLong:0], NSGeneralPboard, 472 [NSNumber numberWithLong:0], NSPasteboardNameGeneral,
473 [NSNumber numberWithLong:0], NXPrimaryPboard, 473 [NSNumber numberWithLong:0], NXPrimaryPboard,
474 [NSNumber numberWithLong:0], NXSecondaryPboard, 474 [NSNumber numberWithLong:0], NXSecondaryPboard,
475 [NSNumber numberWithLong:0], NSStringPboardType, 475 [NSNumber numberWithLong:0], NSStringPboardType,
diff --git a/src/nsterm.h b/src/nsterm.h
index c81bf5fb63d..e669c95931f 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -1322,5 +1322,10 @@ enum NSWindowTabbingMode
1322 NSWindowTabbingModePreferred, 1322 NSWindowTabbingModePreferred,
1323 NSWindowTabbingModeDisallowed 1323 NSWindowTabbingModeDisallowed
1324 }; 1324 };
1325#endif /* !defined (NS_IMPL_COCOA) || !defined (MAC_OS_X_VERSION_10_12) */
1326
1327#if !defined (NS_IMPL_COCOA) || !defined (MAC_OS_X_VERSION_10_13)
1328/* Deprecated in macOS 10.13. */
1329#define NSPasteboardNameGeneral NSGeneralPboard
1325#endif 1330#endif
1326#endif /* HAVE_NS */ 1331#endif /* HAVE_NS */
diff --git a/src/nsterm.m b/src/nsterm.m
index 50e06c94d45..07ac8f978f9 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6016,7 +6016,13 @@ not_in_argv (NSString *arg)
6016 6016
6017 if (!NSIsEmptyRect (visible)) 6017 if (!NSIsEmptyRect (visible))
6018 [self addCursorRect: visible cursor: currentCursor]; 6018 [self addCursorRect: visible cursor: currentCursor];
6019 [currentCursor setOnMouseEntered: YES]; 6019
6020#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 101300
6021#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
6022 if ([currentCursor respondsToSelector: @selector(setOnMouseEntered)])
6023#endif
6024 [currentCursor setOnMouseEntered: YES];
6025#endif
6020} 6026}
6021 6027
6022 6028
@@ -8746,7 +8752,14 @@ not_in_argv (NSString *arg)
8746 8752
8747 if (!NSIsEmptyRect (visible)) 8753 if (!NSIsEmptyRect (visible))
8748 [self addCursorRect: visible cursor: [NSCursor arrowCursor]]; 8754 [self addCursorRect: visible cursor: [NSCursor arrowCursor]];
8749 [[NSCursor arrowCursor] setOnMouseEntered: YES]; 8755
8756#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 101300
8757#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
8758 if ([[NSCursor arrowCursor] respondsToSelector:
8759 @selector(setOnMouseEntered)])
8760#endif
8761 [[NSCursor arrowCursor] setOnMouseEntered: YES];
8762#endif
8750} 8763}
8751 8764
8752 8765