fix: macOS correctly restore window when hidden with command+H
This commit is contained in:
committed by
Chris Rizzitello
parent
bf4f513d7e
commit
e4ecbdae8a
@ -1055,6 +1055,9 @@ void MainWindow::enableClient(bool enable)
|
||||
|
||||
void MainWindow::showAndActivate()
|
||||
{
|
||||
#ifdef Q_OS_MAC
|
||||
forceAppActive();
|
||||
#endif
|
||||
show();
|
||||
raise();
|
||||
activateWindow();
|
||||
|
||||
@ -30,4 +30,5 @@ void requestOSXNotificationPermission();
|
||||
bool isOSXDevelopmentBuild();
|
||||
bool showOSXNotification(const QString &title, const QString &body);
|
||||
bool isOSXInterfaceStyleDark();
|
||||
void forceAppActive();
|
||||
IconsTheme getOSXIconsTheme();
|
||||
|
||||
@ -107,6 +107,11 @@ bool isOSXInterfaceStyleDark()
|
||||
return (style && [style isKindOfClass:[NSString class]] && NSOrderedSame == [style caseInsensitiveCompare:@"dark"]);
|
||||
}
|
||||
|
||||
void forceAppActive()
|
||||
{
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
IconsTheme getOSXIconsTheme()
|
||||
{
|
||||
if (@available(macOS 11, *))
|
||||
|
||||
Reference in New Issue
Block a user