[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/10] ui/cocoa: Drop workarounds for pre-10.12 OSX
From: |
Gerd Hoffmann |
Subject: |
[PULL 10/10] ui/cocoa: Drop workarounds for pre-10.12 OSX |
Date: |
Wed, 12 Feb 2020 17:18:35 +0100 |
From: Peter Maydell <address@hidden>
Our official OSX support policy covers the last two released versions.
Currently that is 10.14 and 10.15. We also may work on older versions, but
don't guarantee it.
In commit 50290c002c045280f8d in mid-2019 we introduced some uses of
CLOCK_MONOTONIC which incidentally broke compilation for pre-10.12 OSX
versions (see LP:1861551). We don't intend to fix that, so we might
as well drop the code in ui/cocoa.m which caters for pre-10.12
versions as well. (For reference, 10.11 fell out of Apple extended
security support in September 2018.)
Signed-off-by: Peter Maydell <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/cocoa.m | 59 ------------------------------------------------------
1 file changed, 59 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index f7b323044582..747a70839af8 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -42,60 +42,10 @@
#include <Carbon/Carbon.h>
#include "hw/core/cpu.h"
-#ifndef MAC_OS_X_VERSION_10_5
-#define MAC_OS_X_VERSION_10_5 1050
-#endif
-#ifndef MAC_OS_X_VERSION_10_6
-#define MAC_OS_X_VERSION_10_6 1060
-#endif
-#ifndef MAC_OS_X_VERSION_10_9
-#define MAC_OS_X_VERSION_10_9 1090
-#endif
-#ifndef MAC_OS_X_VERSION_10_10
-#define MAC_OS_X_VERSION_10_10 101000
-#endif
-#ifndef MAC_OS_X_VERSION_10_12
-#define MAC_OS_X_VERSION_10_12 101200
-#endif
#ifndef MAC_OS_X_VERSION_10_13
#define MAC_OS_X_VERSION_10_13 101300
#endif
-/* macOS 10.12 deprecated many constants, #define the new names for older SDKs
*/
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
-#define NSEventMaskAny NSAnyEventMask
-#define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask
-#define NSEventModifierFlagShift NSShiftKeyMask
-#define NSEventModifierFlagCommand NSCommandKeyMask
-#define NSEventModifierFlagControl NSControlKeyMask
-#define NSEventModifierFlagOption NSAlternateKeyMask
-#define NSEventTypeFlagsChanged NSFlagsChanged
-#define NSEventTypeKeyUp NSKeyUp
-#define NSEventTypeKeyDown NSKeyDown
-#define NSEventTypeMouseMoved NSMouseMoved
-#define NSEventTypeLeftMouseDown NSLeftMouseDown
-#define NSEventTypeRightMouseDown NSRightMouseDown
-#define NSEventTypeOtherMouseDown NSOtherMouseDown
-#define NSEventTypeLeftMouseDragged NSLeftMouseDragged
-#define NSEventTypeRightMouseDragged NSRightMouseDragged
-#define NSEventTypeOtherMouseDragged NSOtherMouseDragged
-#define NSEventTypeLeftMouseUp NSLeftMouseUp
-#define NSEventTypeRightMouseUp NSRightMouseUp
-#define NSEventTypeOtherMouseUp NSOtherMouseUp
-#define NSEventTypeScrollWheel NSScrollWheel
-#define NSTextAlignmentCenter NSCenterTextAlignment
-#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
-#define NSWindowStyleMaskClosable NSClosableWindowMask
-#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
-#define NSWindowStyleMaskTitled NSTitledWindowMask
-#endif
-/* 10.13 deprecates NSFileHandlingPanelOKButton in favour of
- * NSModalResponseOK, which was introduced in 10.9. Define
- * it for older versions.
- */
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
-#define NSModalResponseOK NSFileHandlingPanelOKButton
-#endif
/* 10.14 deprecates NSOnState and NSOffState in favor of
* NSControlStateValueOn/Off, which were introduced in 10.13.
* Define for older versions
@@ -466,11 +416,7 @@ QemuCocoaView *cocoaView;
COCOA_DEBUG("QemuCocoaView: drawRect\n");
// get CoreGraphic context
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10
- CGContextRef viewContextRef = [[NSGraphicsContext currentContext]
graphicsPort];
-#else
CGContextRef viewContextRef = [[NSGraphicsContext currentContext]
CGContext];
-#endif
CGContextSetInterpolationQuality (viewContextRef, kCGInterpolationNone);
CGContextSetShouldAntialias (viewContextRef, NO);
@@ -1076,9 +1022,7 @@ QemuCocoaView *cocoaView;
------------------------------------------------------
*/
@interface QemuCocoaAppController : NSObject
-#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
<NSWindowDelegate,
NSApplicationDelegate>
-#endif
{
}
- (void)doToggleFullScreen:(id)sender;
@@ -1127,9 +1071,6 @@ QemuCocoaView *cocoaView;
[normalWindow setAcceptsMouseMovedEvents:YES];
[normalWindow setTitle:@"QEMU"];
[normalWindow setContentView:cocoaView];
-#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10)
- [normalWindow useOptimizedDrawing:YES];
-#endif
[normalWindow makeKeyAndOrderFront:self];
[normalWindow center];
[normalWindow setDelegate: self];
--
2.18.2
- [PULL 00/10] Ui 20200212 patches, Gerd Hoffmann, 2020/02/12
- [PULL 01/10] ui/gtk: Update gd_refresh_rate_millihz() to handle VirtualConsole, Gerd Hoffmann, 2020/02/12
- [PULL 08/10] ui: drop curor_hide global variable., Gerd Hoffmann, 2020/02/12
- [PULL 10/10] ui/cocoa: Drop workarounds for pre-10.12 OSX,
Gerd Hoffmann <=
- [PULL 06/10] ui/cocoa: switch to new show-cursor option, Gerd Hoffmann, 2020/02/12
- [PULL 03/10] ui: add show-cursor option, Gerd Hoffmann, 2020/02/12
- [PULL 04/10] ui: wire up legacy -show-cursor option, Gerd Hoffmann, 2020/02/12
- [PULL 05/10] ui/sdl: switch to new show-cursor option, Gerd Hoffmann, 2020/02/12
- [PULL 02/10] ui/gtk: Fix gd_refresh_rate_millihz() when widget window is not realized, Gerd Hoffmann, 2020/02/12
- [PULL 09/10] ui: deprecate legacy -show-cursor option, Gerd Hoffmann, 2020/02/12
- [PULL 07/10] ui/gtk: implement show-cursor option, Gerd Hoffmann, 2020/02/12
- Re: [PULL 00/10] Ui 20200212 patches, Peter Maydell, 2020/02/13