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.
oldstable
Ken Thomases 2013-09-26 23:46:31 -05:00 committed by Alexandre Julliard
parent f78ffb374d
commit d7f4d67514
3 changed files with 16 additions and 2 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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];