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 "gui/tls/TlsFingerprint.h"
|
||||||
#include "platform/wayland.h"
|
#include "platform/wayland.h"
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
|
||||||
#include "gui/OSXHelpers.h"
|
|
||||||
#endif
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@
|
||||||
#include "gui/core/WaylandWarnings.h"
|
#include "gui/core/WaylandWarnings.h"
|
||||||
#include "gui/tls/TlsUtility.h"
|
#include "gui/tls/TlsUtility.h"
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
#include "gui/OSXHelpers.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class QAction;
|
class QAction;
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
|
|
@ -94,6 +98,13 @@ public:
|
||||||
}
|
}
|
||||||
void autoAddScreen(const QString name);
|
void autoAddScreen(const QString name);
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
void hide()
|
||||||
|
{
|
||||||
|
macOSNativeHide();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void shown();
|
void shown();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,5 @@ bool isOSXDevelopmentBuild();
|
||||||
bool showOSXNotification(const QString &title, const QString &body);
|
bool showOSXNotification(const QString &title, const QString &body);
|
||||||
bool isOSXInterfaceStyleDark();
|
bool isOSXInterfaceStyleDark();
|
||||||
void forceAppActive();
|
void forceAppActive();
|
||||||
|
void macOSNativeHide();
|
||||||
IconsTheme getOSXIconsTheme();
|
IconsTheme getOSXIconsTheme();
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,11 @@ void forceAppActive()
|
||||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void macOSNativeHide()
|
||||||
|
{
|
||||||
|
[NSApp hide:nil];
|
||||||
|
}
|
||||||
|
|
||||||
IconsTheme getOSXIconsTheme()
|
IconsTheme getOSXIconsTheme()
|
||||||
{
|
{
|
||||||
if (@available(macOS 11, *))
|
if (@available(macOS 11, *))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue