From: Brendan Shanks bshanks@codeweavers.com
--- dlls/winemac.drv/cocoa_app.m | 4 +--- dlls/winemac.drv/cocoa_cursorclipping.m | 11 +++-------- dlls/winemac.drv/cocoa_window.m | 25 ++----------------------- dlls/winemac.drv/opengl.c | 4 ---- 4 files changed, 6 insertions(+), 38 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index 82334d477cd..85ce592c363 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -256,13 +256,11 @@ - (void) transformProcessToForeground:(BOOL)activateIfTransformed if (activateIfTransformed) [self tryToActivateIgnoringOtherApps:YES];
-#if defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 - if (!enable_app_nap && [NSProcessInfo instancesRespondToSelector:@selector(beginActivityWithOptions:reason:)]) + if (!enable_app_nap) { [[[NSProcessInfo processInfo] beginActivityWithOptions:NSActivityUserInitiatedAllowingIdleSystemSleep reason:@"Running Windows program"] retain]; // intentional leak } -#endif
mainMenu = [[[NSMenu alloc] init] autorelease];
diff --git a/dlls/winemac.drv/cocoa_cursorclipping.m b/dlls/winemac.drv/cocoa_cursorclipping.m index cfb7ff529e7..b7dc0b322b1 100644 --- a/dlls/winemac.drv/cocoa_cursorclipping.m +++ b/dlls/winemac.drv/cocoa_cursorclipping.m @@ -428,14 +428,9 @@ @implementation WineConfinementClipCursorHandler
+ (BOOL) isAvailable { - if ([NSProcessInfo instancesRespondToSelector:@selector(isOperatingSystemAtLeastVersion:)]) - { - NSOperatingSystemVersion requiredVersion = { 10, 13, 0 }; - return [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:requiredVersion] && - [NSWindow instancesRespondToSelector:@selector(setMouseConfinementRect:)]; - } - - return FALSE; + NSOperatingSystemVersion requiredVersion = { 10, 13, 0 }; + return [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:requiredVersion] && + [NSWindow instancesRespondToSelector:@selector(setMouseConfinementRect:)]; }
/* Returns the region of the given rect that intersects with the given diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 7aa3dbf81c7..0d2862218ec 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -36,13 +36,6 @@
#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
-#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 -/* Additional Mac virtual keycode, to complement those in Carbon's <HIToolbox/Events.h>. */ -enum { - kVK_RightCommand = 0x36, /* Invented for Wine; was unused */ -}; -#endif -
@interface NSWindow (PrivatePreventsActivation)
@@ -2279,10 +2272,8 @@ - (void) checkWineDisplayLink NSScreen* screen = self.screen; if (![self isVisible] || ![self isOnActiveSpace] || [self isMiniaturized] || [self isEmptyShaped]) screen = nil; -#if defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 - if ([self respondsToSelector:@selector(occlusionState)] && !(self.occlusionState & NSWindowOcclusionStateVisible)) + if (!(self.occlusionState & NSWindowOcclusionStateVisible)) screen = nil; -#endif
NSNumber* displayIDNumber = screen.deviceDescription[@"NSScreenNumber"]; CGDirectDisplayID displayID = [displayIDNumber unsignedIntValue]; @@ -3808,10 +3799,6 @@ void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, ma WineWindow* oldWindow = (WineWindow*)[view window]; WineWindow* newWindow = (WineWindow*)[superview window];
-#if !defined(MAC_OS_X_VERSION_10_10) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10 - if (floor(NSAppKitVersionNumber) <= 1265 /*NSAppKitVersionNumber10_9*/) - [view removeFromSuperview]; -#endif if (prev) [superview addSubview:view positioned:NSWindowBelow relativeTo:prev]; else @@ -3882,15 +3869,7 @@ macdrv_metal_device macdrv_create_metal_device(void) { @autoreleasepool { - macdrv_metal_device ret; - -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_11 - if (MTLCreateSystemDefaultDevice == NULL) - return NULL; -#endif - - ret = (macdrv_metal_device)MTLCreateSystemDefaultDevice(); - return ret; + return (macdrv_metal_device)MTLCreateSystemDefaultDevice(); } }
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c index ac87cfc1313..94f1915d62b 100644 --- a/dlls/winemac.drv/opengl.c +++ b/dlls/winemac.drv/opengl.c @@ -1457,14 +1457,10 @@ static BOOL create_context(struct wgl_context *context, CGLContextObj share, uns if (core) { attribs[n++] = kCGLPFAOpenGLProfile; -#if defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 if (major == 3) attribs[n++] = (int)kCGLOGLPVersion_GL3_Core; else attribs[n++] = (int)kCGLOGLPVersion_GL4_Core; -#else - attribs[n++] = (int)kCGLOGLPVersion_3_2_Core; -#endif }
attribs[n] = 0;
From: Brendan Shanks bshanks@codeweavers.com
--- dlls/winemac.drv/cocoa_app.h | 1 - dlls/winemac.drv/cocoa_app.m | 56 +++++++++++------------------------- 2 files changed, 17 insertions(+), 40 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_app.h b/dlls/winemac.drv/cocoa_app.h index b2b8187e0b4..9ba4d86e319 100644 --- a/dlls/winemac.drv/cocoa_app.h +++ b/dlls/winemac.drv/cocoa_app.h @@ -128,7 +128,6 @@ @interface WineApplicationController : NSObject <NSApplicationDelegate> BOOL beenActive;
NSMutableSet* windowsBeingDragged; - BOOL useDragNotifications; }
@property (nonatomic) CGEventSourceKeyboardType keyboardType; diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index 85ce592c363..500b933005a 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -191,15 +191,6 @@ - (id) init
windowsBeingDragged = [[NSMutableSet alloc] init];
- // On macOS 10.12+, use notifications to more reliably detect when windows are being dragged. - if ([NSProcessInfo instancesRespondToSelector:@selector(isOperatingSystemAtLeastVersion:)]) - { - NSOperatingSystemVersion requiredVersion = { 10, 12, 0 }; - useDragNotifications = [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:requiredVersion]; - } - else - useDragNotifications = NO; - if (!requests || !requestsManipQueue || !eventQueues || !eventQueuesLock || !keyWindows || !originalDisplayModes || !latentDisplayModes) { @@ -1844,17 +1835,6 @@ - (BOOL) handleEvent:(NSEvent*)anEvent [window postKeyEvent:anEvent]; } } - else if (!useDragNotifications && type == NSEventTypeAppKitDefined) - { - WineWindow *window = (WineWindow *)[anEvent window]; - short subtype = [anEvent subtype]; - - // These subtypes are not documented but they appear to mean - // "a window is being dragged" and "a window is no longer being - // dragged", respectively. - if ((subtype == 20 || subtype == 21) && [window isKindOfClass:[WineWindow class]]) - [self handleWindowDrag:window begin:(subtype == 20)]; - }
return ret; } @@ -1914,25 +1894,23 @@ - (void) setupObservations [windowsBeingDragged removeObject:window]; }];
- if (useDragNotifications) { - [nc addObserverForName:NSWindowWillStartDraggingNotification - object:nil - queue:[NSOperationQueue mainQueue] - usingBlock:^(NSNotification *note){ - NSWindow* window = [note object]; - if ([window isKindOfClass:[WineWindow class]]) - [self handleWindowDrag:(WineWindow *)window begin:YES]; - }]; - - [nc addObserverForName:NSWindowDidEndDraggingNotification - object:nil - queue:[NSOperationQueue mainQueue] - usingBlock:^(NSNotification *note){ - NSWindow* window = [note object]; - if ([window isKindOfClass:[WineWindow class]]) - [self handleWindowDrag:(WineWindow *)window begin:NO]; - }]; - } + [nc addObserverForName:NSWindowWillStartDraggingNotification + object:nil + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification *note){ + NSWindow* window = [note object]; + if ([window isKindOfClass:[WineWindow class]]) + [self handleWindowDrag:(WineWindow *)window begin:YES]; + }]; + + [nc addObserverForName:NSWindowDidEndDraggingNotification + object:nil + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification *note){ + NSWindow* window = [note object]; + if ([window isKindOfClass:[WineWindow class]]) + [self handleWindowDrag:(WineWindow *)window begin:NO]; + }];
[nc addObserver:self selector:@selector(keyboardSelectionDidChange)
From: Brendan Shanks bshanks@codeweavers.com
--- dlls/winecoreaudio.drv/coreaudio.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c index 377f3f5f035..a94b576e848 100644 --- a/dlls/winecoreaudio.drv/coreaudio.c +++ b/dlls/winecoreaudio.drv/coreaudio.c @@ -47,6 +47,7 @@ #include <AudioToolbox/AudioFormat.h> #include <AudioToolbox/AudioConverter.h> #include <AudioUnit/AudioUnit.h> +#include <os/lock.h>
#undef LoadResource #undef CompareString @@ -73,15 +74,6 @@ #define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster #endif
-#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 -#include <os/lock.h> -#else -#include <libkern/OSAtomic.h> -typedef OSSpinLock os_unfair_lock; -#define os_unfair_lock_lock(lock) OSSpinLockLock(lock) -#define os_unfair_lock_unlock(lock) OSSpinLockUnlock(lock) -#endif - WINE_DEFAULT_DEBUG_CHANNEL(coreaudio);
struct coreaudio_stream
This merge request was approved by Huw Davies.