fix: Mac Os use Native Hide Event
This commit is contained in:
parent
ba334d5411
commit
351c5123ef
4 changed files with 17 additions and 3 deletions
|
|
@ -36,9 +36,6 @@
|
|||
#include "gui/tls/TlsFingerprint.h"
|
||||
#include "platform/wayland.h"
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#include "gui/OSXHelpers.h"
|
||||
#endif
|
||||
#if defined(Q_OS_LINUX)
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@
|
|||
#include "gui/core/WaylandWarnings.h"
|
||||
#include "gui/tls/TlsUtility.h"
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include "gui/OSXHelpers.h"
|
||||
#endif
|
||||
|
||||
class QAction;
|
||||
class QMenu;
|
||||
class QLineEdit;
|
||||
|
|
@ -94,6 +98,13 @@ public:
|
|||
}
|
||||
void autoAddScreen(const QString name);
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
void hide()
|
||||
{
|
||||
macOSNativeHide();
|
||||
}
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void shown();
|
||||
|
||||
|
|
|
|||
|
|
@ -31,4 +31,5 @@ bool isOSXDevelopmentBuild();
|
|||
bool showOSXNotification(const QString &title, const QString &body);
|
||||
bool isOSXInterfaceStyleDark();
|
||||
void forceAppActive();
|
||||
void macOSNativeHide();
|
||||
IconsTheme getOSXIconsTheme();
|
||||
|
|
|
|||
|
|
@ -112,6 +112,11 @@ void forceAppActive()
|
|||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
void macOSNativeHide()
|
||||
{
|
||||
[NSApp hide:nil];
|
||||
}
|
||||
|
||||
IconsTheme getOSXIconsTheme()
|
||||
{
|
||||
if (@available(macOS 11, *))
|
||||
|
|
|
|||
Loading…
Reference in a new issue