Commit 1186c36c authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Make clicking on the app's dock icon unminimize a window if there are…

winemac: Make clicking on the app's dock icon unminimize a window if there are only minimized windows. Cocoa would automatically do this for a normal app. However, the Mac driver makes all of its windows inherit from NSPanel and Cocoa ignores panels for this feature.
parent 63fe00ea
......@@ -1915,6 +1915,21 @@ int macdrv_err_on;
}
}
- (void) unminimizeWindowIfNoneVisible
{
if (![self frontWineWindow])
{
for (WineWindow* window in [NSApp windows])
{
if ([window isKindOfClass:[WineWindow class]] && [window isMiniaturized])
{
[window deminiaturize:self];
break;
}
}
}
}
/*
* ---------- NSApplicationDelegate methods ----------
......@@ -1935,17 +1950,8 @@ int macdrv_err_on;
[self updateFullscreenWindows];
[self adjustWindowLevels:YES];
if (beenActive && ![self frontWineWindow])
{
for (WineWindow* window in [NSApp windows])
{
if ([window isKindOfClass:[WineWindow class]] && [window isMiniaturized])
{
[window deminiaturize:self];
break;
}
}
}
if (beenActive)
[self unminimizeWindowIfNoneVisible];
beenActive = TRUE;
// If a Wine process terminates abruptly while it has the display captured
......@@ -1997,6 +2003,14 @@ int macdrv_err_on;
[self releaseMouseCapture];
}
- (BOOL) applicationShouldHandleReopen:(NSApplication*)theApplication hasVisibleWindows:(BOOL)flag
{
// Note that "flag" is often wrong. WineWindows are NSPanels and NSPanels
// don't count as "visible windows" for this purpose.
[self unminimizeWindowIfNoneVisible];
return YES;
}
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender
{
NSApplicationTerminateReply ret = NSTerminateNow;
......
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