Commit 6447e8e7 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

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.
parent 3cd67795
...@@ -488,8 +488,8 @@ int macdrv_err_on; ...@@ -488,8 +488,8 @@ int macdrv_err_on;
- (void) adjustWindowLevels:(BOOL)active - (void) adjustWindowLevels:(BOOL)active
{ {
NSArray* windowNumbers = [NSWindow windowNumbersWithOptions:0]; NSArray* windowNumbers;
NSMutableArray* wineWindows = [[NSMutableArray alloc] initWithCapacity:[windowNumbers count]]; NSMutableArray* wineWindows;
NSNumber* windowNumber; NSNumber* windowNumber;
NSUInteger nextFloatingIndex = 0; NSUInteger nextFloatingIndex = 0;
__block NSInteger maxLevel = NSIntegerMin; __block NSInteger maxLevel = NSIntegerMin;
...@@ -497,6 +497,11 @@ int macdrv_err_on; ...@@ -497,6 +497,11 @@ int macdrv_err_on;
__block WineWindow* prev = nil; __block WineWindow* prev = nil;
WineWindow* window; 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 // 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 // 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 // one of the windows has been changed, it may be in the wrong level and thus
...@@ -2127,6 +2132,11 @@ int macdrv_err_on; ...@@ -2127,6 +2132,11 @@ int macdrv_err_on;
[self releaseMouseCapture]; [self releaseMouseCapture];
} }
- (void) applicationDidUnhide:(NSNotification*)aNotification
{
[self adjustWindowLevels];
}
- (BOOL) applicationShouldHandleReopen:(NSApplication*)theApplication hasVisibleWindows:(BOOL)flag - (BOOL) applicationShouldHandleReopen:(NSApplication*)theApplication hasVisibleWindows:(BOOL)flag
{ {
// Note that "flag" is often wrong. WineWindows are NSPanels and NSPanels // Note that "flag" is often wrong. WineWindows are NSPanels and NSPanels
......
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