winemac: Fix the logic for checking if a view is already in the intended z-order.
-[NSView subviews] returns the views in back-to-front order, not front-to-back as I had thought. Signed-off-by: Ken Thomases <ken@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bdbb3514bb
commit
102cd6dcae
|
@ -3343,11 +3343,11 @@ void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, ma
|
|||
{
|
||||
NSArray* subviews = [superview subviews];
|
||||
NSUInteger index = [subviews indexOfObjectIdenticalTo:view];
|
||||
if (!prev && !next && index == 0)
|
||||
if (!prev && !next && index == [subviews count] - 1)
|
||||
return;
|
||||
if (prev && index > 0 && [subviews objectAtIndex:index - 1] == prev)
|
||||
if (prev && index + 1 < [subviews count] && [subviews objectAtIndex:index + 1] == prev)
|
||||
return;
|
||||
if (!prev && next && index + 1 < [subviews count] && [subviews objectAtIndex:index + 1] == next)
|
||||
if (!prev && next && index > 0 && [subviews objectAtIndex:index - 1] == next)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue