From c8d4b1cc5e9d69a8dc0e6150d768fc2b02b5ad6a Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Thu, 16 May 2013 18:43:50 -0500 Subject: [PATCH] winemac: Order front in -makeKeyAndOrderFront:; we only override to control key status. When we have windows on two different spaces and the user switches between them by clicking our Dock icon, Cocoa inexplicably sends the switched-to window to the back of the z-order. It's only -makeKeyAndOrderFront: that brings it forward again, but our override broke that. --- dlls/winemac.drv/cocoa_window.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index cec86b569db..d2b2547fab2 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -1051,8 +1051,16 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers) /* We don't call this. It's the action method of the items in the Window menu. */ - (void) makeKeyAndOrderFront:(id)sender { + WineApplicationController* controller = [WineApplicationController sharedController]; + WineWindow* front = [controller frontWineWindow]; + if (![self isKeyWindow] && !self.disabled && !self.noActivate) - [[WineApplicationController sharedController] windowGotFocus:self]; + [controller windowGotFocus:self]; + + if (front && [self level] < [front level]) + [self setLevel:[front level]]; + [self orderFront:nil]; + [controller adjustWindowLevels]; } - (void) sendEvent:(NSEvent*)event