Ken Thomases : winemac: Defer adjusting window levels while the process is hidden.

Alexandre Julliard julliard at winehq.org
Tue Dec 31 11:11:44 CST 2013


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

Author: Ken Thomases <ken at codeweavers.com>
Date:   Tue Dec 31 01:05:05 2013 -0600

winemac: Defer adjusting window levels while the process is hidden.

While the process is hidden, it can't get a list of its windows which would
be visible were it not hidden.

---

 dlls/winemac.drv/cocoa_app.m |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
index c31bceb..17644d0 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -488,8 +488,8 @@ int macdrv_err_on;
 
     - (void) adjustWindowLevels:(BOOL)active
     {
-        NSArray* windowNumbers = [NSWindow windowNumbersWithOptions:0];
-        NSMutableArray* wineWindows = [[NSMutableArray alloc] initWithCapacity:[windowNumbers count]];
+        NSArray* windowNumbers;
+        NSMutableArray* wineWindows;
         NSNumber* windowNumber;
         NSUInteger nextFloatingIndex = 0;
         __block NSInteger maxLevel = NSIntegerMin;
@@ -497,6 +497,11 @@ int macdrv_err_on;
         __block WineWindow* prev = nil;
         WineWindow* window;
 
+        if ([NSApp isHidden]) return;
+
+        windowNumbers = [NSWindow windowNumbersWithOptions:0];
+        wineWindows = [[NSMutableArray alloc] initWithCapacity:[windowNumbers count]];
+
         // For the most part, we rely on the window server's ordering of the windows
         // to be authoritative.  The one exception is if the "floating" property of
         // one of the windows has been changed, it may be in the wrong level and thus
@@ -2127,6 +2132,11 @@ int macdrv_err_on;
         [self releaseMouseCapture];
     }
 
+    - (void) applicationDidUnhide:(NSNotification*)aNotification
+    {
+        [self adjustWindowLevels];
+    }
+
     - (BOOL) applicationShouldHandleReopen:(NSApplication*)theApplication hasVisibleWindows:(BOOL)flag
     {
         // Note that "flag" is often wrong.  WineWindows are NSPanels and NSPanels




More information about the wine-cvs mailing list