Module: wine Branch: master Commit: d7f4d67514b3febac084d48d22fef67fd328fdce URL: http://source.winehq.org/git/wine.git/?a=commit;h=d7f4d67514b3febac084d48d22...
Author: Ken Thomases ken@codeweavers.com Date: Thu Sep 26 23:46:31 2013 -0500
winemac: Fix hiding windows that are minimized using -close instead of -orderOut:.
Cocoa won't order a minimized window out of the screen list using -orderOut:. This leaves a window that should be hidden still visible in the Dock, where it can be unminimized.
---
dlls/winemac.drv/cocoa_app.m | 2 ++ dlls/winemac.drv/cocoa_window.h | 2 ++ dlls/winemac.drv/cocoa_window.m | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index afe0608..e6e5c2e 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -1809,6 +1809,8 @@ int macdrv_err_on; queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note){ NSWindow* window = [note object]; + if ([window isKindOfClass:[WineWindow class]] && [(WineWindow*)window isFakingClose]) + return; [keyWindows removeObjectIdenticalTo:window]; if (window == lastTargetWindow) lastTargetWindow = nil; diff --git a/dlls/winemac.drv/cocoa_window.h b/dlls/winemac.drv/cocoa_window.h index 8893f85..8f60275 100644 --- a/dlls/winemac.drv/cocoa_window.h +++ b/dlls/winemac.drv/cocoa_window.h @@ -60,6 +60,7 @@
BOOL ignore_windowMiniaturize; BOOL ignore_windowDeminiaturize; + BOOL fakingClose; }
@property (retain, readonly, nonatomic) WineEventQueue* queue; @@ -67,6 +68,7 @@ @property (readonly, nonatomic) BOOL noActivate; @property (readonly, nonatomic) BOOL floating; @property (readonly, getter=isFullscreen, nonatomic) BOOL fullscreen; +@property (readonly, getter=isFakingClose, nonatomic) BOOL fakingClose;
- (NSInteger) minimumLevelForActive:(BOOL)active; - (void) updateFullscreen; diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 43be5d5..74bbdc7 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -139,6 +139,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers) @property (readwrite, nonatomic) BOOL disabled; @property (readwrite, nonatomic) BOOL noActivate; @property (readwrite, nonatomic) BOOL floating; +@property (readwrite, getter=isFakingClose, nonatomic) BOOL fakingClose; @property (retain, nonatomic) NSWindow* latentParentWindow;
@property (nonatomic) void* hwnd; @@ -466,7 +467,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
static WineWindow* causing_becomeKeyWindow;
- @synthesize disabled, noActivate, floating, fullscreen, latentParentWindow, hwnd, queue; + @synthesize disabled, noActivate, floating, fullscreen, fakingClose, latentParentWindow, hwnd, queue; @synthesize surface, surface_mutex; @synthesize shape, shapeChangedSinceLastDraw; @synthesize colorKeyed, colorKeyRed, colorKeyGreen, colorKeyBlue; @@ -497,6 +498,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers) [window setHidesOnDeactivate:NO]; [window setReleasedWhenClosed:NO];
+ [window setOneShot:YES]; [window disableCursorRects]; [window setShowsResizeIndicator:NO]; [window setHasShadow:wf->shadow]; @@ -1039,7 +1041,14 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers) pendingMinimize = TRUE;
[self becameIneligibleParentOrChild]; - [self orderOut:nil]; + if ([self isMiniaturized]) + { + fakingClose = TRUE; + [self close]; + fakingClose = FALSE; + } + else + [self orderOut:nil]; if (wasVisible && wasOnActiveSpace && fullscreen) [controller updateFullscreenWindows]; [controller adjustWindowLevels]; @@ -1548,6 +1557,7 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers) { WineWindow* child;
+ if (fakingClose) return; if (latentParentWindow) { [latentParentWindow->latentChildWindows removeObjectIdenticalTo:self];