Commit 5ebb83ad authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Defer ordering a window out if it's in the process of entering or…

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: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 302593c9
......@@ -33,6 +33,7 @@
BOOL maximized;
BOOL fullscreen;
BOOL pendingMinimize;
BOOL pendingOrderOut;
BOOL savedVisibleState;
BOOL drawnSinceShown;
WineWindow* latentParentWindow;
......
......@@ -1614,6 +1614,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
[self checkWineDisplayLink];
needAdjustWindowLevels = TRUE;
}
pendingOrderOut = FALSE;
if ([self becameEligibleParentOrChild])
needAdjustWindowLevels = TRUE;
......@@ -1649,6 +1650,21 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
BOOL wasVisible = [self isVisible];
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])
pendingMinimize = TRUE;
......@@ -2707,6 +2723,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
{
enteringFullScreen = FALSE;
enteredFullScreenTime = [[NSProcessInfo processInfo] systemUptime];
if (pendingOrderOut)
[self doOrderOut];
}
- (void) windowDidExitFullScreen:(NSNotification*)notification
......@@ -2714,18 +2732,24 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
exitingFullScreen = FALSE;
[self setFrameAndWineFrame:nonFullscreenFrame];
[self windowDidResize:nil];
if (pendingOrderOut)
[self doOrderOut];
}
- (void) windowDidFailToEnterFullScreen:(NSWindow*)window
{
enteringFullScreen = FALSE;
enteredFullScreenTime = 0;
if (pendingOrderOut)
[self doOrderOut];
}
- (void) windowDidFailToExitFullScreen:(NSWindow*)window
{
exitingFullScreen = FALSE;
[self windowDidResize:nil];
if (pendingOrderOut)
[self doOrderOut];
}
- (void)windowDidMiniaturize:(NSNotification *)notification
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment