Ken Thomases : winemac: Tell Wine that Cocoa brought a window forward even if a window is being dragged.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 2 08:32:23 CST 2015


Module: wine
Branch: master
Commit: 8ec1b4f010952bfee423c66c9b6b5a7e248814d9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8ec1b4f010952bfee423c66c9b6b5a7e248814d9

Author: Ken Thomases <ken at codeweavers.com>
Date:   Thu Jan 29 16:49:30 2015 -0600

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 119de2a..5afb7f8 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -1585,6 +1585,7 @@ int macdrv_err_on;
         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 @@ int macdrv_err_on;
         {
             BOOL pressed = (type == NSLeftMouseDown || type == NSRightMouseDown || type == NSOtherMouseDown);
             CGPoint pt = CGEventGetLocation([theEvent CGEvent]);
-            BOOL process;
 
             if (clippingCursor)
                 [self clipCursorLocation:&pt];
@@ -1689,12 +1689,13 @@ int macdrv_err_on;
 
                 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




More information about the wine-cvs mailing list