Ken Thomases : winemac: Track which window was brought forward by Cocoa separately from the window receiving the click event.

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


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

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

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 1196987..119de2a 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];
             }
         }
 




More information about the wine-cvs mailing list