summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2021-01-27 13:23:18 -0800
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2021-02-01 16:21:39 -0800
commit5ad49102722274f53b9b011082d9e0f202fcd9a4 (patch)
treee99ecc3e8bd98396e9e01ceb03ed2c9433cf0b4f
parent6e6db055f8b517ae9d63351d4c00fd480cb6b54a (diff)
xquartz: Remove support for Leopard and earlier versions of macOS
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r--hw/xquartz/X11Controller.h5
-rw-r--r--hw/xquartz/X11Controller.m6
-rw-r--r--hw/xquartz/quartz.c6
-rw-r--r--hw/xquartz/quartzRandR.c150
-rw-r--r--hw/xquartz/xpr/xprScreen.c7
5 files changed, 1 insertions, 173 deletions
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index 84c7ce6d8..29008c593 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -46,10 +46,7 @@
#undef BOOL
#endif
-@interface X11Controller : NSObject
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- <NSTableViewDataSource>
-#endif
+@interface X11Controller : NSObject <NSTableViewDataSource>
{
IBOutlet NSPanel *prefs_panel;
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index c75493c42..81ad3c639 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -868,13 +868,7 @@ extern char *bundle_id_prefix;
- (IBAction) x11_help:sender
{
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
- AHLookupAnchor((CFStringRef)NSLocalizedString(@"Mac Help",
- no comment),
- CFSTR("mchlp2276"));
-#else
AHLookupAnchor(CFSTR("com.apple.machelp"), CFSTR("mchlp2276"));
-#endif
}
- (OSX_BOOL) validateMenuItem:(NSMenuItem *)item
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 980aa4a36..8a3c5a2d3 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -72,12 +72,6 @@
#include <rootlessCommon.h>
#include <Xplugin.h>
-/* Work around a bug on Leopard's headers */
-#if defined (__LP64__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 && MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-extern OSErr UpdateSystemActivity(UInt8 activity);
-#define OverallAct 0
-#endif
-
DevPrivateKeyRec quartzScreenKeyRec;
int aquaMenuBarHeight = 0;
QuartzModeProcsPtr quartzProcs = NULL;
diff --git a/hw/xquartz/quartzRandR.c b/hw/xquartz/quartzRandR.c
index cb470fa8e..2e0c7b53d 100644
--- a/hw/xquartz/quartzRandR.c
+++ b/hw/xquartz/quartzRandR.c
@@ -66,154 +66,6 @@ static Bool ignore_next_fake_mode_update = FALSE;
typedef int (*QuartzModeCallback)
(ScreenPtr, QuartzModeInfoPtr, void *);
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-
-static long
-getDictLong(CFDictionaryRef dictRef, CFStringRef key)
-{
- long value;
-
- CFNumberRef numRef = (CFNumberRef)CFDictionaryGetValue(dictRef, key);
- if (!numRef)
- return 0;
-
- if (!CFNumberGetValue(numRef, kCFNumberLongType, &value))
- return 0;
- return value;
-}
-
-static double
-getDictDouble(CFDictionaryRef dictRef, CFStringRef key)
-{
- double value;
-
- CFNumberRef numRef = (CFNumberRef)CFDictionaryGetValue(dictRef, key);
- if (!numRef)
- return 0.0;
-
- if (!CFNumberGetValue(numRef, kCFNumberDoubleType, &value))
- return 0.0;
- return value;
-}
-
-static void
-QuartzRandRGetModeInfo(CFDictionaryRef modeRef,
- QuartzModeInfoPtr pMode)
-{
- pMode->width = (size_t)getDictLong(modeRef, kCGDisplayWidth);
- pMode->height = (size_t)getDictLong(modeRef, kCGDisplayHeight);
- pMode->refresh =
- (int)(getDictDouble(modeRef, kCGDisplayRefreshRate) + 0.5);
- if (pMode->refresh == 0)
- pMode->refresh = DEFAULT_REFRESH;
- pMode->ref = NULL;
- pMode->pSize = NULL;
-}
-
-static Bool
-QuartzRandRCopyCurrentModeInfo(CGDirectDisplayID screenId,
- QuartzModeInfoPtr pMode)
-{
- CFDictionaryRef curModeRef = CGDisplayCurrentMode(screenId);
- if (!curModeRef)
- return FALSE;
-
- QuartzRandRGetModeInfo(curModeRef, pMode);
- pMode->ref = (void *)curModeRef;
- CFRetain(pMode->ref);
- return TRUE;
-}
-
-static Bool
-QuartzRandRSetCGMode(CGDirectDisplayID screenId,
- QuartzModeInfoPtr pMode)
-{
- CFDictionaryRef modeRef = (CFDictionaryRef)pMode->ref;
- return (CGDisplaySwitchToMode(screenId, modeRef) == kCGErrorSuccess);
-}
-
-static Bool
-QuartzRandREnumerateModes(ScreenPtr pScreen,
- QuartzModeCallback callback,
- void *data)
-{
- Bool retval = FALSE;
- QuartzScreenPtr pQuartzScreen = QUARTZ_PRIV(pScreen);
-
- /* Just an 800x600 fallback if we have no attached heads */
- if (pQuartzScreen->displayIDs) {
- CFDictionaryRef curModeRef, modeRef;
- long curBpp;
- CFArrayRef modes;
- QuartzModeInfo modeInfo;
- int i;
- CGDirectDisplayID screenId = pQuartzScreen->displayIDs[0];
-
- curModeRef = CGDisplayCurrentMode(screenId);
- if (!curModeRef)
- return FALSE;
- curBpp = getDictLong(curModeRef, kCGDisplayBitsPerPixel);
-
- modes = CGDisplayAvailableModes(screenId);
- if (!modes)
- return FALSE;
- for (i = 0; i < CFArrayGetCount(modes); i++) {
- int cb;
- modeRef = (CFDictionaryRef)CFArrayGetValueAtIndex(modes, i);
-
- /* Skip modes that are not usable on the current display or have a
- different pixel encoding than the current mode. */
- if (((unsigned long)getDictLong(modeRef, kCGDisplayIOFlags) &
- kDisplayModeUsableFlags) != kDisplayModeUsableFlags)
- continue;
- if (getDictLong(modeRef, kCGDisplayBitsPerPixel) != curBpp)
- continue;
-
- QuartzRandRGetModeInfo(modeRef, &modeInfo);
- modeInfo.ref = (void *)modeRef;
- cb = callback(pScreen, &modeInfo, data);
- if (cb == CALLBACK_CONTINUE)
- retval = TRUE;
- else if (cb == CALLBACK_SUCCESS)
- return TRUE;
- else if (cb == CALLBACK_ERROR)
- return FALSE;
- }
- }
-
- switch (callback(pScreen, &pQuartzScreen->rootlessMode, data)) {
- case CALLBACK_SUCCESS:
- return TRUE;
-
- case CALLBACK_ERROR:
- return FALSE;
-
- case CALLBACK_CONTINUE:
- retval = TRUE;
-
- default:
- break;
- }
-
- switch (callback(pScreen, &pQuartzScreen->fullscreenMode, data)) {
- case CALLBACK_SUCCESS:
- return TRUE;
-
- case CALLBACK_ERROR:
- return FALSE;
-
- case CALLBACK_CONTINUE:
- retval = TRUE;
-
- default:
- break;
- }
-
- return retval;
-}
-
-#else /* we have the new CG APIs from Snow Leopard */
-
static void
QuartzRandRGetModeInfo(CGDisplayModeRef modeRef,
QuartzModeInfoPtr pMode)
@@ -350,8 +202,6 @@ QuartzRandREnumerateModes(ScreenPtr pScreen,
return retval;
}
-#endif /* Snow Leopard CoreGraphics APIs */
-
static Bool
QuartzRandRModesEqual(QuartzModeInfoPtr pMode1,
QuartzModeInfoPtr pMode2)
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 74ea86b5c..f54870dd9 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -331,10 +331,6 @@ xprAddScreen(int index, ScreenPtr pScreen)
DEBUG_LOG("index=%d depth=%d\n", index, depth);
if (depth == -1) {
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
- depth = CGDisplaySamplesPerPixel(kCGDirectMainDisplay) *
- CGDisplayBitsPerSample(kCGDirectMainDisplay);
-#else
CGDisplayModeRef modeRef;
CFStringRef encStrRef;
@@ -364,12 +360,9 @@ xprAddScreen(int index, ScreenPtr pScreen)
}
CFRelease(encStrRef);
-#endif
}
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
have_depth:
-#endif
switch (depth) {
case 8: // pseudo-working
dfb->visuals = PseudoColorMask;