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.
This commit is contained in:
parent
0d4a26eff5
commit
8343e7ce4d
|
@ -697,6 +697,14 @@ - (BOOL) orderBelow:(WineWindow*)prev orAbove:(WineWindow*)next
|
|||
{
|
||||
[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 @@ - (BOOL) orderBelow:(WineWindow*)prev orAbove:(WineWindow*)next
|
|||
[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 @@ - (void) makeFocused:(BOOL)activate
|
|||
}
|
||||
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 @@ - (void) makeFocused:(BOOL)activate
|
|||
[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];
|
||||
|
||||
|
|
Loading…
Reference in New Issue