Ken Thomases : winemac: Fix z-ordering between two child (owned) windows of the same parent (owner).

Alexandre Julliard julliard at winehq.org
Mon May 21 17:15:11 CDT 2018


Module: wine
Branch: master
Commit: 64704bef1865b0729ef81e46675d5b1183b49ed9
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=64704bef1865b0729ef81e46675d5b1183b49ed9

Author: Ken Thomases <ken at codeweavers.com>
Date:   Mon May 21 13:39:02 2018 -0500

winemac: Fix z-ordering between two child (owned) windows of the same parent (owner).

The window being ordered was first put in the correct place and then was moved
to the other end of the children list by the loop that was intended to adjust
the windows strictly between the window and the ancestor.

Signed-off-by: Ken Thomases <ken at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winemac.drv/cocoa_window.m | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index b94b774..e37e071 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -1590,14 +1590,17 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
                                 [ancestor orderWindow:orderingMode relativeTo:[ancestorOfOther windowNumber]];
                         }
 
-                        for (child = self;
-                             (parent = (WineWindow*)child.parentWindow);
-                             child = parent)
+                        if (!ancestorOfOther || ancestor != self)
                         {
-                            if ([parent isKindOfClass:[WineWindow class]])
-                                [parent order:-orderingMode childWindow:child relativeTo:nil];
-                            if (parent == ancestor)
-                                break;
+                            for (child = self;
+                                 (parent = (WineWindow*)child.parentWindow);
+                                 child = parent)
+                            {
+                                if ([parent isKindOfClass:[WineWindow class]])
+                                    [parent order:-orderingMode childWindow:child relativeTo:nil];
+                                if (parent == ancestor)
+                                    break;
+                            }
                         }
 
                         [self checkWineDisplayLink];




More information about the wine-cvs mailing list