winemac: Defer ordering a window out if it's in the process of entering or exiting Cocoa full-screen mode.
Cocoa doesn't handle the window being ordered out or closed during the animation well and leaves a ghost window around. Signed-off-by: Ken Thomases <ken@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
302593c9c0
commit
5ebb83ad4e
|
@ -33,6 +33,7 @@ @interface WineWindow : NSPanel <NSWindowDelegate>
|
||||||
BOOL maximized;
|
BOOL maximized;
|
||||||
BOOL fullscreen;
|
BOOL fullscreen;
|
||||||
BOOL pendingMinimize;
|
BOOL pendingMinimize;
|
||||||
|
BOOL pendingOrderOut;
|
||||||
BOOL savedVisibleState;
|
BOOL savedVisibleState;
|
||||||
BOOL drawnSinceShown;
|
BOOL drawnSinceShown;
|
||||||
WineWindow* latentParentWindow;
|
WineWindow* latentParentWindow;
|
||||||
|
|
|
@ -1614,6 +1614,7 @@ - (void) orderBelow:(WineWindow*)prev orAbove:(WineWindow*)next activate:(BOOL)a
|
||||||
[self checkWineDisplayLink];
|
[self checkWineDisplayLink];
|
||||||
needAdjustWindowLevels = TRUE;
|
needAdjustWindowLevels = TRUE;
|
||||||
}
|
}
|
||||||
|
pendingOrderOut = FALSE;
|
||||||
|
|
||||||
if ([self becameEligibleParentOrChild])
|
if ([self becameEligibleParentOrChild])
|
||||||
needAdjustWindowLevels = TRUE;
|
needAdjustWindowLevels = TRUE;
|
||||||
|
@ -1649,6 +1650,21 @@ - (void) doOrderOut
|
||||||
BOOL wasVisible = [self isVisible];
|
BOOL wasVisible = [self isVisible];
|
||||||
BOOL wasOnActiveSpace = [self isOnActiveSpace];
|
BOOL wasOnActiveSpace = [self isOnActiveSpace];
|
||||||
|
|
||||||
|
if (enteringFullScreen || exitingFullScreen)
|
||||||
|
{
|
||||||
|
pendingOrderOut = TRUE;
|
||||||
|
[queue discardEventsMatchingMask:event_mask_for_type(WINDOW_BROUGHT_FORWARD) |
|
||||||
|
event_mask_for_type(WINDOW_GOT_FOCUS) |
|
||||||
|
event_mask_for_type(WINDOW_LOST_FOCUS) |
|
||||||
|
event_mask_for_type(WINDOW_MAXIMIZE_REQUESTED) |
|
||||||
|
event_mask_for_type(WINDOW_MINIMIZE_REQUESTED) |
|
||||||
|
event_mask_for_type(WINDOW_RESTORE_REQUESTED)
|
||||||
|
forWindow:self];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
pendingOrderOut = FALSE;
|
||||||
|
|
||||||
if ([self isMiniaturized])
|
if ([self isMiniaturized])
|
||||||
pendingMinimize = TRUE;
|
pendingMinimize = TRUE;
|
||||||
|
|
||||||
|
@ -2707,6 +2723,8 @@ - (void) windowDidEnterFullScreen:(NSNotification*)notification
|
||||||
{
|
{
|
||||||
enteringFullScreen = FALSE;
|
enteringFullScreen = FALSE;
|
||||||
enteredFullScreenTime = [[NSProcessInfo processInfo] systemUptime];
|
enteredFullScreenTime = [[NSProcessInfo processInfo] systemUptime];
|
||||||
|
if (pendingOrderOut)
|
||||||
|
[self doOrderOut];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) windowDidExitFullScreen:(NSNotification*)notification
|
- (void) windowDidExitFullScreen:(NSNotification*)notification
|
||||||
|
@ -2714,18 +2732,24 @@ - (void) windowDidExitFullScreen:(NSNotification*)notification
|
||||||
exitingFullScreen = FALSE;
|
exitingFullScreen = FALSE;
|
||||||
[self setFrameAndWineFrame:nonFullscreenFrame];
|
[self setFrameAndWineFrame:nonFullscreenFrame];
|
||||||
[self windowDidResize:nil];
|
[self windowDidResize:nil];
|
||||||
|
if (pendingOrderOut)
|
||||||
|
[self doOrderOut];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) windowDidFailToEnterFullScreen:(NSWindow*)window
|
- (void) windowDidFailToEnterFullScreen:(NSWindow*)window
|
||||||
{
|
{
|
||||||
enteringFullScreen = FALSE;
|
enteringFullScreen = FALSE;
|
||||||
enteredFullScreenTime = 0;
|
enteredFullScreenTime = 0;
|
||||||
|
if (pendingOrderOut)
|
||||||
|
[self doOrderOut];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) windowDidFailToExitFullScreen:(NSWindow*)window
|
- (void) windowDidFailToExitFullScreen:(NSWindow*)window
|
||||||
{
|
{
|
||||||
exitingFullScreen = FALSE;
|
exitingFullScreen = FALSE;
|
||||||
[self windowDidResize:nil];
|
[self windowDidResize:nil];
|
||||||
|
if (pendingOrderOut)
|
||||||
|
[self doOrderOut];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidMiniaturize:(NSNotification *)notification
|
- (void)windowDidMiniaturize:(NSNotification *)notification
|
||||||
|
|
Loading…
Reference in New Issue