Skip to content
Snippets Groups Projects
Commit 1186c36c authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -1915,6 +1915,21 @@ - (void) releaseMouseCapture
}
}
- (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 @@ - (void)applicationDidBecomeActive:(NSNotification *)notification
[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 @@ - (void)applicationDidResignActive:(NSNotification *)notification
[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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment