From 5fe3c4b89e0676aa0442a0f3dbde82977881db4d Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Thu, 29 Jan 2015 16:49:01 -0600 Subject: [PATCH] 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. --- dlls/winemac.drv/cocoa_app.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index 11969875c6b..119de2a1048 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -1584,7 +1584,7 @@ int macdrv_err_on; { 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 @@ int macdrv_err_on; { 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 @@ int macdrv_err_on; NSPoint point = [button convertPoint:[theEvent locationInWindow] fromView:nil]; if ([button mouse:point inRect:[button bounds]]) { - broughtWindowForward = FALSE; + windowBroughtForward = nil; break; } } @@ -1689,11 +1689,11 @@ int macdrv_err_on; 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]; } } -- 2.11.4.GIT