Commit 102cd6dc authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

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: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent bdbb3514
...@@ -3343,11 +3343,11 @@ void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, ma ...@@ -3343,11 +3343,11 @@ void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, ma
{ {
NSArray* subviews = [superview subviews]; NSArray* subviews = [superview subviews];
NSUInteger index = [subviews indexOfObjectIdenticalTo:view]; NSUInteger index = [subviews indexOfObjectIdenticalTo:view];
if (!prev && !next && index == 0) if (!prev && !next && index == [subviews count] - 1)
return; return;
if (prev && index > 0 && [subviews objectAtIndex:index - 1] == prev) if (prev && index + 1 < [subviews count] && [subviews objectAtIndex:index + 1] == prev)
return; return;
if (!prev && next && index + 1 < [subviews count] && [subviews objectAtIndex:index + 1] == next) if (!prev && next && index > 0 && [subviews objectAtIndex:index - 1] == next)
return; return;
} }
......
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