Ken Thomases : winemac: Don't bring owned windows to the front when they' re clicked.

Alexandre Julliard julliard at winehq.org
Thu May 8 13:35:20 CDT 2014


Module: wine
Branch: master
Commit: 3bca22a6b9d49bbf0255adfc06444227d6228c51
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3bca22a6b9d49bbf0255adfc06444227d6228c51

Author: Ken Thomases <ken at codeweavers.com>
Date:   Wed May  7 17:09:29 2014 -0500

winemac: Don't bring owned windows to the front when they're clicked.

Cocoa will bring an unowned window to the front of its level when it's clicked,
but it doesn't do that for owned windows.  The old code went out of its way to
make owned windows behave like unowned windows in this respect.  That was
exactly backward.  We wish we could control whether windows are raised on a
click.  We don't have that opportunity for unowned windows, but, by ripping
out a bunch of code, we do for owned windows.

---

 dlls/winemac.drv/cocoa_app.m |   54 ------------------------------------------
 1 file changed, 54 deletions(-)

diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
index ab045b2..e5594d1 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -1597,60 +1597,6 @@ int macdrv_err_on;
                     }
                 }
             }
-
-            if (broughtWindowForward)
-            {
-                // Clicking on a child window does not normally reorder it with
-                // respect to its siblings, but we want it to.  We have to do it
-                // manually.
-                NSWindow* parent = [window parentWindow];
-                NSInteger level = [window level];
-                __block BOOL needReorder = FALSE;
-                NSMutableArray* higherLevelSiblings = [NSMutableArray array];
-
-                // If the window is already the last child or if it's only below
-                // children with higher window level, then no need to reorder it.
-                [[parent childWindows] enumerateObjectsWithOptions:NSEnumerationReverse
-                                                        usingBlock:^(id obj, NSUInteger idx, BOOL *stop){
-                    WineWindow* child = obj;
-                    if (child == window)
-                        *stop = TRUE;
-                    else if ([child level] <= level)
-                    {
-                        needReorder = TRUE;
-                        *stop = TRUE;
-                    }
-                    else
-                        [higherLevelSiblings insertObject:child atIndex:0];
-                }];
-
-                if (needReorder)
-                {
-                    WineWindow* sibling;
-
-                    NSDisableScreenUpdates();
-
-                    [parent removeChildWindow:window];
-                    for (sibling in higherLevelSiblings)
-                        [parent removeChildWindow:sibling];
-
-                    [parent addChildWindow:window ordered:NSWindowAbove];
-                    for (sibling in higherLevelSiblings)
-                    {
-                        // Setting a window as a child can reset its level to be
-                        // the same as the parent, so save it and restore it.
-                        // The call to -setLevel: puts the window at the front
-                        // of its level but testing shows that that's what Cocoa
-                        // does when you click on any window in an ownership
-                        // hierarchy, anyway.
-                        level = [sibling level];
-                        [parent addChildWindow:sibling ordered:NSWindowAbove];
-                        [sibling setLevel:level];
-                    }
-
-                    NSEnableScreenUpdates();
-                }
-            }
         }
 
         if ([windowsBeingDragged count])




More information about the wine-cvs mailing list