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