winemac: Unminimize a window on activation if there are only minimized windows.

This commit is contained in:
Ken Thomases 2013-05-08 10:46:02 -05:00 committed by Alexandre Julliard
parent 6f1c143ad5
commit 08e940fb1d
1 changed files with 22 additions and 0 deletions

View File

@ -1613,6 +1613,10 @@ - (BOOL) inputSourceIsInputMethod
*/
- (void)applicationDidBecomeActive:(NSNotification *)notification
{
WineWindow* window;
WineWindow* firstMinimized;
BOOL anyShowing;
[self activateCursorClipping];
[orderedWineWindows enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(id obj, NSUInteger idx, BOOL *stop){
@ -1621,6 +1625,24 @@ - (void)applicationDidBecomeActive:(NSNotification *)notification
[window setLevel:[window levelWhenActive]];
}];
firstMinimized = nil;
anyShowing = FALSE;
for (window in orderedWineWindows)
{
if ([window isMiniaturized])
{
if (!firstMinimized)
firstMinimized = window;
}
else if ([window isVisible])
{
anyShowing = TRUE;
break;
}
}
if (!anyShowing && firstMinimized)
[firstMinimized deminiaturize:self];
// If a Wine process terminates abruptly while it has the display captured
// and switched to a different resolution, Mac OS X will uncapture the
// displays and switch their resolutions back. However, the other Wine