xquartz: Remove support for Tiger and earlier versions of macOS

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 6e6db055f8)
This commit is contained in:
Jeremy Huddleston Sequoia 2021-01-27 13:18:35 -08:00
parent 080f9eb76a
commit 2d7eb82499
7 changed files with 7 additions and 95 deletions

View File

@ -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.
@ -1236,18 +1232,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");
@ -1640,11 +1629,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];
@ -1666,7 +1650,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
@ -1793,7 +1776,6 @@ handle_mouse:
}
if (darwinSyncKeymap) {
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
TISInputSourceRef key_layout =
TISCopyCurrentKeyboardLayoutInputSource();
TISInputSourceRef clear;
@ -1805,12 +1787,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(

View File

@ -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>

View File

@ -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)
{

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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_

View File

@ -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;