winemac: Track which window was brought forward by Cocoa separately from the window receiving the click event.
If the mouse is captured, we change which window receives the click event, but that shouldn't change which window we tell Wine was brought forward by Cocoa.
This commit is contained in:
parent
2b97f8c1d1
commit
5fe3c4b89e
|
@ -1584,7 +1584,7 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
{
|
||||
WineWindow* window = (WineWindow*)[theEvent window];
|
||||
NSEventType type = [theEvent type];
|
||||
BOOL broughtWindowForward = FALSE;
|
||||
WineWindow* windowBroughtForward = nil;
|
||||
|
||||
if ([window isKindOfClass:[WineWindow class]] &&
|
||||
type == NSLeftMouseDown &&
|
||||
|
@ -1592,7 +1592,7 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
{
|
||||
NSWindowButton windowButton;
|
||||
|
||||
broughtWindowForward = TRUE;
|
||||
windowBroughtForward = window;
|
||||
|
||||
/* Any left-click on our window anyplace other than the close or
|
||||
minimize buttons will bring it forward. */
|
||||
|
@ -1606,7 +1606,7 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
NSPoint point = [button convertPoint:[theEvent locationInWindow] fromView:nil];
|
||||
if ([button mouse:point inRect:[button bounds]])
|
||||
{
|
||||
broughtWindowForward = FALSE;
|
||||
windowBroughtForward = nil;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1689,11 +1689,11 @@ - (void) handleMouseButton:(NSEvent*)theEvent
|
|||
|
||||
macdrv_release_event(event);
|
||||
}
|
||||
else if (broughtWindowForward)
|
||||
else if (windowBroughtForward)
|
||||
{
|
||||
[[window ancestorWineWindow] postBroughtForwardEvent];
|
||||
if (![window isKeyWindow] && !window.disabled && !window.noActivate)
|
||||
[self windowGotFocus:window];
|
||||
[[windowBroughtForward ancestorWineWindow] postBroughtForwardEvent];
|
||||
if (![windowBroughtForward isKeyWindow] && !windowBroughtForward.disabled && !windowBroughtForward.noActivate)
|
||||
[self windowGotFocus:windowBroughtForward];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue