Commit 5c992f96 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Don't post a WINDOW_BROUGHT_FORWARD event for a click on a window which…

winemac: Don't post a WINDOW_BROUGHT_FORWARD event for a click on a window which is already frontmost in its level. Commit 793ab7d4 fixed a bug where WINDOW_BROUGHT_FORWARD events weren't being posted when they should, but it caused a regression in Scribblenauts Unlimited. Every click caused a window ordering operation that generated messages and Scribblenauts would move the mouse cursor to the upper-left corner of the window in response. Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ebcf8aad
......@@ -1745,7 +1745,23 @@ static NSString* WineLocalizedString(unsigned int stringID)
if (windowBroughtForward)
{
[[windowBroughtForward ancestorWineWindow] postBroughtForwardEvent];
WineWindow* ancestor = [windowBroughtForward ancestorWineWindow];
NSInteger ancestorNumber = [ancestor windowNumber];
NSInteger ancestorLevel = [ancestor level];
for (NSNumber* windowNumberObject in [NSWindow windowNumbersWithOptions:0])
{
NSInteger windowNumber = [windowNumberObject integerValue];
if (windowNumber == ancestorNumber)
break;
WineWindow* otherWindow = (WineWindow*)[NSApp windowWithWindowNumber:windowNumber];
if ([otherWindow isKindOfClass:[WineWindow class]] && [otherWindow screen] &&
[otherWindow level] <= ancestorLevel && otherWindow == [otherWindow ancestorWineWindow])
{
[ancestor postBroughtForwardEvent];
break;
}
}
if (!process && ![windowBroughtForward isKeyWindow] && !windowBroughtForward.disabled && !windowBroughtForward.noActivate)
[self windowGotFocus:windowBroughtForward];
}
......
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