Commit 8343e7ce authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Set up window's latent parent-child relationship before ordering the window.

Making a window a child reorders it to be immediately above or below its parent, potentially undoing the ordering we had just done.
parent 0d4a26ef
......@@ -697,6 +697,14 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
{
[controller transformProcessToForeground];
if (latentParentWindow)
{
if ([latentParentWindow level] > [self level])
[self setLevelWhenActive:[latentParentWindow level]];
[latentParentWindow addChildWindow:self ordered:NSWindowAbove];
[controller wineWindow:self ordered:NSWindowAbove relativeTo:latentParentWindow];
self.latentParentWindow = nil;
}
if (prev)
{
/* Make sure that windows that should be above this one really are.
......@@ -728,14 +736,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[self orderWindow:NSWindowAbove relativeTo:[next windowNumber]];
[controller wineWindow:self ordered:NSWindowAbove relativeTo:next];
}
if (latentParentWindow)
{
if ([latentParentWindow level] > [self level])
[self setLevelWhenActive:[latentParentWindow level]];
[latentParentWindow addChildWindow:self ordered:NSWindowAbove];
[controller wineWindow:self ordered:NSWindowAbove relativeTo:latentParentWindow];
self.latentParentWindow = nil;
}
/* Cocoa may adjust the frame when the window is ordered onto the screen.
Generate a frame-changed event just in case. The back end will ignore
......@@ -922,11 +922,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
}
if (activate)
[NSApp activateIgnoringOtherApps:YES];
[self orderFront:nil];
[controller wineWindow:self ordered:NSWindowAbove relativeTo:nil];
causing_becomeKeyWindow = TRUE;
[self makeKeyWindow];
causing_becomeKeyWindow = FALSE;
if (latentParentWindow)
{
if ([latentParentWindow level] > [self level])
......@@ -935,6 +930,11 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[controller wineWindow:self ordered:NSWindowAbove relativeTo:latentParentWindow];
self.latentParentWindow = nil;
}
[self orderFront:nil];
[controller wineWindow:self ordered:NSWindowAbove relativeTo:nil];
causing_becomeKeyWindow = TRUE;
[self makeKeyWindow];
causing_becomeKeyWindow = FALSE;
if (![self isExcludedFromWindowsMenu])
[NSApp addWindowsItem:self title:[self title] filename:NO];
......
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