Commit 8dae8ad8 authored by Tim Clem's avatar Tim Clem Committed by Alexandre Julliard

winemac.drv: Don't activate the app if its first window is WS_EX_NOACTIVATE.

This matches the behavior on Windows. Signed-off-by: 's avatarTim Clem <tclem@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent e58b1a2b
......@@ -142,7 +142,7 @@ enum {
+ (WineApplicationController*) sharedController;
- (void) transformProcessToForeground;
- (void) transformProcessToForeground:(BOOL)activateIfTransformed;
- (BOOL) registerEventQueue:(WineEventQueue*)queue;
- (void) unregisterEventQueue:(WineEventQueue*)queue;
......
......@@ -237,7 +237,7 @@ static NSString* WineLocalizedString(unsigned int stringID)
[super dealloc];
}
- (void) transformProcessToForeground
- (void) transformProcessToForeground:(BOOL)activateIfTransformed
{
if ([NSApp activationPolicy] != NSApplicationActivationPolicyRegular)
{
......@@ -248,7 +248,10 @@ static NSString* WineLocalizedString(unsigned int stringID)
NSMenuItem* item;
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
[NSApp activateIgnoringOtherApps:YES];
if (activateIfTransformed)
[NSApp activateIgnoringOtherApps: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:)])
{
......@@ -884,7 +887,7 @@ static NSString* WineLocalizedString(unsigned int stringID)
if (!modes.count)
return FALSE;
[self transformProcessToForeground];
[self transformProcessToForeground:YES];
BOOL active = [NSApp isActive];
......
......@@ -28,6 +28,7 @@
{
BOOL disabled;
BOOL noForeground;
BOOL preventsAppActivation;
BOOL floating;
BOOL resizable;
BOOL maximized;
......@@ -91,6 +92,7 @@
@property (retain, readonly, nonatomic) WineEventQueue* queue;
@property (readonly, nonatomic) BOOL disabled;
@property (readonly, nonatomic) BOOL noForeground;
@property (readonly, nonatomic) BOOL preventsAppActivation;
@property (readonly, nonatomic) BOOL floating;
@property (readonly, getter=isFullscreen, nonatomic) BOOL fullscreen;
@property (readonly, getter=isFakingClose, nonatomic) BOOL fakingClose;
......
......@@ -391,6 +391,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
@property (readwrite, nonatomic) BOOL disabled;
@property (readwrite, nonatomic) BOOL noForeground;
@property (readwrite, nonatomic) BOOL preventsAppActivation;
@property (readwrite, nonatomic) BOOL floating;
@property (readwrite, nonatomic) BOOL drawnSinceShown;
@property (readwrite, nonatomic) BOOL closing;
......@@ -954,7 +955,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
static WineWindow* causing_becomeKeyWindow;
@synthesize disabled, noForeground, floating, fullscreen, fakingClose, closing, latentParentWindow, hwnd, queue;
@synthesize disabled, noForeground, preventsAppActivation, floating, fullscreen, fakingClose, closing, latentParentWindow, hwnd, queue;
@synthesize drawnSinceShown;
@synthesize surface, surface_mutex;
@synthesize shapeChangedSinceLastDraw;
......@@ -1143,6 +1144,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
NSUInteger currentStyle = [self styleMask];
NSUInteger newStyle = style_mask_for_features(wf) | (currentStyle & ~usedStyles);
self.preventsAppActivation = wf->prevents_app_activation;
if (newStyle != currentStyle)
{
NSString* title = [[[self title] copy] autorelease];
......@@ -1686,7 +1689,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
WineWindow* parent;
WineWindow* child;
[controller transformProcessToForeground];
[controller transformProcessToForeground:!self.preventsAppActivation];
if ([NSApp isHidden])
[NSApp unhide:nil];
wasVisible = [self isVisible];
......@@ -2056,7 +2059,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
{
if (activate)
{
[[WineApplicationController sharedController] transformProcessToForeground];
[[WineApplicationController sharedController] transformProcessToForeground:YES];
[NSApp activateIgnoringOtherApps:YES];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment