Commit d22ac28f authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Allow clicks on owned windows to reorder them relative to other owned…

winemac: Allow clicks on owned windows to reorder them relative to other owned windows of the same owner.
parent f6924b96
......@@ -1424,16 +1424,50 @@ int macdrv_err_on;
- (void) handleMouseButton:(NSEvent*)theEvent
{
WineWindow* window;
WineWindow* window = (WineWindow*)[theEvent window];
NSEventType type = [theEvent type];
if ([window isKindOfClass:[WineWindow class]] &&
type == NSLeftMouseDown &&
(([theEvent modifierFlags] & (NSShiftKeyMask | NSControlKeyMask| NSAlternateKeyMask | NSCommandKeyMask)) != NSCommandKeyMask))
{
NSWindowButton windowButton;
BOOL broughtWindowForward = TRUE;
/* Any left-click on our window anyplace other than the close or
minimize buttons will bring it forward. */
for (windowButton = NSWindowCloseButton;
windowButton <= NSWindowMiniaturizeButton;
windowButton++)
{
NSButton* button = [window standardWindowButton:windowButton];
if (button)
{
NSPoint point = [button convertPoint:[theEvent locationInWindow] fromView:nil];
if ([button mouse:point inRect:[button bounds]])
{
broughtWindowForward = FALSE;
break;
}
}
}
if (broughtWindowForward)
{
// Clicking on a child window does not normally reorder it with
// respect to its siblings, but we want it to. We have to do it
// manually.
NSWindow* parent = [window parentWindow];
[parent removeChildWindow:window];
[parent addChildWindow:window ordered:NSWindowAbove];
}
}
if (mouseCaptureWindow)
window = mouseCaptureWindow;
else
window = (WineWindow*)[theEvent window];
if ([window isKindOfClass:[WineWindow class]])
{
NSEventType type = [theEvent type];
BOOL pressed = (type == NSLeftMouseDown || type == NSRightMouseDown || type == NSOtherMouseDown);
CGPoint pt = CGEventGetLocation([theEvent CGEvent]);
BOOL process;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment