Commit 3bca22a6 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

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.
parent 3ebb9b7b
......@@ -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])
......
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