Module: wine
Branch: master
Commit: c8d4b1cc5e9d69a8dc0e6150d768fc2b02b5ad6a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c8d4b1cc5e9d69a8dc0e6150d…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Thu May 16 18:43:50 2013 -0500
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 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index cec86b5..d2b2547 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
Module: wine
Branch: master
Commit: 94746f1d2dfc2067b95548cce329e913b70181e5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=94746f1d2dfc2067b95548cce…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Thu May 16 18:43:37 2013 -0500
winemac: In -setFrameIfOnScreen:, avoid some work if the frame didn't change.
---
dlls/winemac.drv/cocoa_window.m | 33 ++++++++++++++++-----------------
1 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 57d6e5d..ae5f40b 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -727,7 +727,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
{
NSArray* screens = [NSScreen screens];
BOOL on_screen = [self isOrderedIn];
- NSRect frame, oldFrame;
if (![screens count]) return on_screen;
@@ -742,8 +741,16 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[self doOrderOut];
}
+ /* The back end is establishing a new window size and position. It's
+ not interested in any stale events regarding those that may be sitting
+ in the queue. */
+ [queue discardEventsMatchingMask:event_mask_for_type(WINDOW_FRAME_CHANGED)
+ forWindow:self];
+
if (!NSIsEmptyRect(contentRect))
{
+ NSRect frame, oldFrame;
+
oldFrame = [self frame];
frame = [self frameRectForContentRect:contentRect];
if (!NSEqualRects(frame, oldFrame))
@@ -752,24 +759,16 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[self setFrameOrigin:frame.origin];
else
[self setFrame:frame display:YES];
- }
- }
- if (on_screen)
- {
- [[WineApplicationController sharedController] adjustWindowLevels];
+ if (on_screen)
+ {
+ [[WineApplicationController sharedController] adjustWindowLevels];
- /* In case Cocoa adjusted the frame we tried to set, generate a frame-changed
- event. The back end will ignore it if nothing actually changed. */
- [self windowDidResize:nil];
- }
- else
- {
- /* The back end is establishing a new window size and position. It's
- not interested in any stale events regarding those that may be sitting
- in the queue. */
- [queue discardEventsMatchingMask:event_mask_for_type(WINDOW_FRAME_CHANGED)
- forWindow:self];
+ /* In case Cocoa adjusted the frame we tried to set, generate a frame-changed
+ event. The back end will ignore it if nothing actually changed. */
+ [self windowDidResize:nil];
+ }
+ }
}
return on_screen;