Ken Thomases : winemac: Only call -[NSApplication unhide:] if the app is actually hidden.

Alexandre Julliard julliard at winehq.org
Thu Jul 21 09:58:53 CDT 2016


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

Author: Ken Thomases <ken at codeweavers.com>
Date:   Wed Jul 20 18:50:25 2016 -0500

winemac: Only call -[NSApplication unhide:] if the app is actually hidden.

This avoids a Cocoa bug where, if an app in the background which is not
hidden calls -unhide:, its main menu bar window is brought forward.  The
active app hasn't actually been changed.  Key events continue to go to
the app in the foreground.  But it's confusing to the user when they
look at the menu bar and, if they click in the menu bar, the background
app really will be activated.

Signed-off-by: Ken Thomases <ken at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winemac.drv/cocoa_window.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m
index 4f59121..808a7e7 100644
--- a/dlls/winemac.drv/cocoa_window.m
+++ b/dlls/winemac.drv/cocoa_window.m
@@ -1427,7 +1427,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
             BOOL wasVisible;
 
             [controller transformProcessToForeground];
-            [NSApp unhide:nil];
+            if ([NSApp isHidden])
+                [NSApp unhide:nil];
             wasVisible = [self isVisible];
 
             if (activate)




More information about the wine-cvs mailing list