diff options
author | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2021-01-27 13:18:35 -0800 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2021-02-01 23:17:34 -0800 |
commit | 3307751aedb9d9cf1bbb5281e0297a6597da8b22 (patch) | |
tree | fc420f5e33a8279ad9b924f07814ab3238369c0b | |
parent | cd9b299a62f2215f0b7613e2a58aa7bad2d61a3f (diff) |
xquartz: Remove support for Tiger and earlier versions of macOS
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 6e6db055f8b517ae9d63351d4c00fd480cb6b54a)
-rw-r--r-- | hw/xquartz/X11Application.m | 25 | ||||
-rw-r--r-- | hw/xquartz/X11Controller.h | 10 | ||||
-rw-r--r-- | hw/xquartz/console_redirect.c | 14 | ||||
-rw-r--r-- | hw/xquartz/mach-startup/bundle-main.c | 11 | ||||
-rw-r--r-- | hw/xquartz/mach-startup/stub.c | 13 | ||||
-rw-r--r-- | hw/xquartz/pbproxy/pbproxy.h | 9 | ||||
-rw-r--r-- | hw/xquartz/quartzKeyboard.c | 20 |
7 files changed, 7 insertions, 95 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 768eecf68..df2dfe064 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -85,11 +85,7 @@ static dispatch_queue_t eventTranslationQueue; extern Bool noTestExtensions; extern Bool noRenderExtension; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 static TISInputSourceRef last_key_layout; -#else -static KeyboardLayoutRef last_key_layout; -#endif /* This preference is only tested on Lion or later as it's not relevant to * earlier OS versions. @@ -1217,18 +1213,11 @@ X11ApplicationMain(int argc, char **argv, char **envp) #endif /* Set the key layout seed before we start the server */ -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 last_key_layout = TISCopyCurrentKeyboardLayoutInputSource(); if (!last_key_layout) ErrorF( "X11ApplicationMain: Unable to determine TISCopyCurrentKeyboardLayoutInputSource() at startup.\n"); -#else - KLGetCurrentKeyboardLayout(&last_key_layout); - if (!last_key_layout) - ErrorF( - "X11ApplicationMain: Unable to determine KLGetCurrentKeyboardLayout() at startup.\n"); -#endif if (!QuartsResyncKeymap(FALSE)) { ErrorF("X11ApplicationMain: Could not build a valid keymap.\n"); @@ -1621,11 +1610,6 @@ handle_mouse: case NSScrollWheel: { -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050 - float deltaX = [e deltaX]; - float deltaY = [e deltaY]; - BOOL isContinuous = NO; -#else CGFloat deltaX = [e deltaX]; CGFloat deltaY = [e deltaY]; CGEventRef cge = [e CGEvent]; @@ -1647,7 +1631,6 @@ handle_mouse: deltaY *= lineHeight / 5.0; } #endif -#endif #if !defined(XPLUGIN_VERSION) || XPLUGIN_VERSION == 0 /* If we're in the background, we need to send a MotionNotify event @@ -1774,7 +1757,6 @@ handle_mouse: } if (darwinSyncKeymap) { -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 TISInputSourceRef key_layout = TISCopyCurrentKeyboardLayoutInputSource(); TISInputSourceRef clear; @@ -1786,12 +1768,7 @@ handle_mouse: clear = last_key_layout; last_key_layout = key_layout; CFRelease(clear); -#else - KeyboardLayoutRef key_layout; - KLGetCurrentKeyboardLayout(&key_layout); - if (key_layout != last_key_layout) { - last_key_layout = key_layout; -#endif + /* Update keyInfo */ if (!QuartsResyncKeymap(TRUE)) { ErrorF( diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h index 1e6027006..24b53a700 100644 --- a/hw/xquartz/X11Controller.h +++ b/hw/xquartz/X11Controller.h @@ -46,16 +46,6 @@ #undef BOOL #endif -#ifndef NSINTEGER_DEFINED -#if __LP64__ || NS_BUILD_32_LIKE_64 -typedef long NSInteger; -typedef unsigned long NSUInteger; -#else -typedef int NSInteger; -typedef unsigned int NSUInteger; -#endif -#endif - @interface X11Controller : NSObject #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 <NSTableViewDataSource> diff --git a/hw/xquartz/console_redirect.c b/hw/xquartz/console_redirect.c index 8fdce4699..30d05ecc0 100644 --- a/hw/xquartz/console_redirect.c +++ b/hw/xquartz/console_redirect.c @@ -316,20 +316,6 @@ xq_asl_init(void) atexit(redirect_atexit); } -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 -#define fls(v) xq_fls(v) - -static inline int fls(int value) { - unsigned int b, v; - - v = *((unsigned int *)&value); - - for(b=0 ; v ; v >>= 1 , b++); - - return b; -} -#endif - int xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd) { diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c index b40366244..51eec85fb 100644 --- a/hw/xquartz/mach-startup/bundle-main.c +++ b/hw/xquartz/mach-startup/bundle-main.c @@ -91,12 +91,8 @@ extern int noPanoramiXExtension; static char __crashreporter_info_buff__[4096] = { 0 }; static const char *__crashreporter_info__ __attribute__((__used__)) = &__crashreporter_info_buff__[0]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 -// This is actually a toolchain requirement, but I'm not sure the correct check, -// but it should be fine to just only include it for Leopard and later. This line -// just tells the linker to never strip this symbol (such as for space optimization) +// This line just tells the linker to never strip this symbol (such as for space optimization) asm (".desc ___crashreporter_info__, 0x10"); -#endif static const char *__crashreporter_info__base = "X.Org X Server " XSERVER_VERSION " Build Date: " BUILD_DATE; @@ -477,14 +473,9 @@ startup_trigger(int argc, char **argv, char **envp) kr = bootstrap_look_up(bootstrap_port, server_bootstrap_name, &mp); if (kr != KERN_SUCCESS) { -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 ErrorF("bootstrap_look_up(%s): %s\n", server_bootstrap_name, bootstrap_strerror( kr)); -#else - ErrorF("bootstrap_look_up(%s): %ul\n", server_bootstrap_name, - (unsigned long)kr); -#endif exit(EXIT_FAILURE); } diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c index 756e4ef2d..fad7ea76d 100644 --- a/hw/xquartz/mach-startup/stub.c +++ b/hw/xquartz/mach-startup/stub.c @@ -61,8 +61,6 @@ aslclient aslc; static void set_x11_path(void) { -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 - CFURLRef appURL = NULL; OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR( @@ -104,11 +102,6 @@ set_x11_path(void) (int)osstatus); exit(11); } -#else - /* TODO: Make Tiger smarter... but TBH, this should never get called on Tiger... */ - strlcpy(x11_path, "/Applications/Utilities/X11.app/Contents/MacOS/X11", - sizeof(x11_path)); -#endif } static int @@ -291,15 +284,9 @@ main(int argc, char **argv, char **envp) } if (kr != KERN_SUCCESS) { -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: bootstrap_look_up(): %s", bootstrap_strerror( kr)); -#else - asl_log(aslc, NULL, ASL_LEVEL_ERR, - "Xquartz: bootstrap_look_up(): %ul", - (unsigned long)kr); -#endif return EXIT_FAILURE; } } diff --git a/hw/xquartz/pbproxy/pbproxy.h b/hw/xquartz/pbproxy/pbproxy.h index c5a07f2d0..1b94097b7 100644 --- a/hw/xquartz/pbproxy/pbproxy.h +++ b/hw/xquartz/pbproxy/pbproxy.h @@ -36,15 +36,6 @@ #include <asl.h> #include <AvailabilityMacros.h> -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 -#if __LP64__ || NS_BUILD_32_LIKE_64 -typedef long NSInteger; -typedef unsigned long NSUInteger; -#else -typedef int NSInteger; -typedef unsigned int NSUInteger; -#endif -#endif #define Cursor X_Cursor #undef _SHAPE_H_ diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c index 86d5d03cd..c2856d72f 100644 --- a/hw/xquartz/quartzKeyboard.c +++ b/hw/xquartz/quartzKeyboard.c @@ -744,7 +744,7 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev) return 1; } -#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +#if !defined(__LP64__) static inline UniChar macroman2ucs(unsigned char c) { @@ -806,7 +806,7 @@ make_dead_key(KeySym in) static Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) { -#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +#if !defined(__LP64__) KeyboardLayoutRef key_layout; int is_uchr = 1; #endif @@ -818,7 +818,6 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) KeySym *k; CFDataRef currentKeyLayoutDataRef = NULL; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 TISInputSourceRef currentKeyLayoutRef = TISCopyCurrentKeyboardLayoutInputSource(); @@ -828,33 +827,28 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) if (currentKeyLayoutDataRef) chr_data = CFDataGetBytePtr(currentKeyLayoutDataRef); } -#endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" // KLGetCurrentKeyboardLayout, KLGetKeyboardLayoutProperty #endif -#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +#if !defined(__LP64__) if (chr_data == NULL) { -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 ErrorF( "X11.app: Error detected in determining keyboard layout. If you are using an Apple-provided keyboard layout, please report this error at http://xquartz.macosforge.org and http://bugreport.apple.com\n"); ErrorF( "X11.app: Debug Info: keyboard_type=%u, currentKeyLayoutRef=%p, currentKeyLayoutDataRef=%p, chr_data=%p\n", (unsigned)keyboard_type, currentKeyLayoutRef, currentKeyLayoutDataRef, chr_data); -#endif KLGetCurrentKeyboardLayout(&key_layout); KLGetKeyboardLayoutProperty(key_layout, kKLuchrData, &chr_data); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 if (chr_data != NULL) { ErrorF( "X11.app: Fallback succeeded, but this is still a bug. Please report the above information.\n"); } -#endif } if (chr_data == NULL) { @@ -866,12 +860,10 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) is_uchr = 0; num_keycodes = 128; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 if (chr_data != NULL) { ErrorF( "X11.app: Fallback succeeded, but this is still a bug. Please report the above information.\n"); } -#endif } #endif @@ -879,10 +871,8 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) #pragma clang diagnostic pop #endif -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 if (currentKeyLayoutRef) CFRelease(currentKeyLayoutRef); -#endif if (chr_data == NULL) { ErrorF("Couldn't get uchr or kchr resource\n"); @@ -906,7 +896,7 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) k = info->keyMap + i * GLYPHS_PER_KEY; for (j = 0; j < 4; j++) { -#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +#if !defined(__LP64__) if (is_uchr) { #endif UniChar s[8]; @@ -935,7 +925,7 @@ QuartzReadSystemKeymap(darwinKeyboardInfo *info) k[j] = ucs2keysym(s[0]); if (dead_key_state != 0) k[j] = make_dead_key(k[j]); } -#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +#if !defined(__LP64__) } else { // kchr UInt32 c, state = 0, state2 = 0; |