From 8ec1b4f010952bfee423c66c9b6b5a7e248814d9 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Thu, 29 Jan 2015 16:49:30 -0600 Subject: [PATCH] winemac: Tell Wine that Cocoa brought a window forward even if a window is being dragged. When a window is being dragged, we prevent delivery of clicks to Wine. We were also preventing telling Wine that a window had been brought forward, but this was incorrect. It prevented clicks in the title bar from activating the window. --- dlls/winemac.drv/cocoa_app.m | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m index 119de2a1048..5afb7f82aad 100644 --- a/dlls/winemac.drv/cocoa_app.m +++ b/dlls/winemac.drv/cocoa_app.m @@ -1585,6 +1585,7 @@ - (void) handleMouseButton:(NSEvent*)theEvent WineWindow* window = (WineWindow*)[theEvent window]; NSEventType type = [theEvent type]; WineWindow* windowBroughtForward = nil; + BOOL process = FALSE; if ([window isKindOfClass:[WineWindow class]] && type == NSLeftMouseDown && @@ -1622,7 +1623,6 @@ - (void) handleMouseButton:(NSEvent*)theEvent { BOOL pressed = (type == NSLeftMouseDown || type == NSRightMouseDown || type == NSOtherMouseDown); CGPoint pt = CGEventGetLocation([theEvent CGEvent]); - BOOL process; if (clippingCursor) [self clipCursorLocation:&pt]; @@ -1689,12 +1689,13 @@ - (void) handleMouseButton:(NSEvent*)theEvent macdrv_release_event(event); } - else if (windowBroughtForward) - { - [[windowBroughtForward ancestorWineWindow] postBroughtForwardEvent]; - if (![windowBroughtForward isKeyWindow] && !windowBroughtForward.disabled && !windowBroughtForward.noActivate) - [self windowGotFocus:windowBroughtForward]; - } + } + + if (!process && windowBroughtForward) + { + [[windowBroughtForward ancestorWineWindow] postBroughtForwardEvent]; + if (![windowBroughtForward isKeyWindow] && !windowBroughtForward.disabled && !windowBroughtForward.noActivate) + [self windowGotFocus:windowBroughtForward]; } // Since mouse button events deliver absolute cursor position, the