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) ...@@ -697,6 +697,14 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
{ {
[controller transformProcessToForeground]; [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) if (prev)
{ {
/* Make sure that windows that should be above this one really are. /* 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) ...@@ -728,14 +736,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[self orderWindow:NSWindowAbove relativeTo:[next windowNumber]]; [self orderWindow:NSWindowAbove relativeTo:[next windowNumber]];
[controller wineWindow:self ordered:NSWindowAbove relativeTo:next]; [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. /* 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 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) ...@@ -922,11 +922,6 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
} }
if (activate) if (activate)
[NSApp activateIgnoringOtherApps:YES]; [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)
{ {
if ([latentParentWindow level] > [self level]) if ([latentParentWindow level] > [self level])
...@@ -935,6 +930,11 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers) ...@@ -935,6 +930,11 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
[controller wineWindow:self ordered:NSWindowAbove relativeTo:latentParentWindow]; [controller wineWindow:self ordered:NSWindowAbove relativeTo:latentParentWindow];
self.latentParentWindow = nil; self.latentParentWindow = nil;
} }
[self orderFront:nil];
[controller wineWindow:self ordered:NSWindowAbove relativeTo:nil];
causing_becomeKeyWindow = TRUE;
[self makeKeyWindow];
causing_becomeKeyWindow = FALSE;
if (![self isExcludedFromWindowsMenu]) if (![self isExcludedFromWindowsMenu])
[NSApp addWindowsItem:self title:[self title] filename:NO]; [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