winemac: Don't post a WINDOW_BROUGHT_FORWARD event for a click on a window which is already frontmost in its level.
Commit 793ab7d45
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: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ebcf8aadc5
commit
5c992f9653
|
@ -1745,7 +1745,23 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
|
||||
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];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue