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.
This commit is contained in:
Ken Thomases 2015-01-29 16:49:30 -06:00 committed by Alexandre Julliard
parent 5fe3c4b89e
commit 8ec1b4f010
1 changed files with 8 additions and 7 deletions

View File

@ -1585,6 +1585,7 @@ - (void) handleMouseButton:(NSEvent*)theEvent
WineWindow* window = (WineWindow*)[theEvent window]; WineWindow* window = (WineWindow*)[theEvent window];
NSEventType type = [theEvent type]; NSEventType type = [theEvent type];
WineWindow* windowBroughtForward = nil; WineWindow* windowBroughtForward = nil;
BOOL process = FALSE;
if ([window isKindOfClass:[WineWindow class]] && if ([window isKindOfClass:[WineWindow class]] &&
type == NSLeftMouseDown && type == NSLeftMouseDown &&
@ -1622,7 +1623,6 @@ - (void) handleMouseButton:(NSEvent*)theEvent
{ {
BOOL pressed = (type == NSLeftMouseDown || type == NSRightMouseDown || type == NSOtherMouseDown); BOOL pressed = (type == NSLeftMouseDown || type == NSRightMouseDown || type == NSOtherMouseDown);
CGPoint pt = CGEventGetLocation([theEvent CGEvent]); CGPoint pt = CGEventGetLocation([theEvent CGEvent]);
BOOL process;
if (clippingCursor) if (clippingCursor)
[self clipCursorLocation:&pt]; [self clipCursorLocation:&pt];
@ -1689,12 +1689,13 @@ - (void) handleMouseButton:(NSEvent*)theEvent
macdrv_release_event(event); macdrv_release_event(event);
} }
else if (windowBroughtForward) }
{
[[windowBroughtForward ancestorWineWindow] postBroughtForwardEvent]; if (!process && windowBroughtForward)
if (![windowBroughtForward isKeyWindow] && !windowBroughtForward.disabled && !windowBroughtForward.noActivate) {
[self windowGotFocus:windowBroughtForward]; [[windowBroughtForward ancestorWineWindow] postBroughtForwardEvent];
} if (![windowBroughtForward isKeyWindow] && !windowBroughtForward.disabled && !windowBroughtForward.noActivate)
[self windowGotFocus:windowBroughtForward];
} }
// Since mouse button events deliver absolute cursor position, the // Since mouse button events deliver absolute cursor position, the