fix: Mac Os use Native Hide Event

This commit is contained in:
sithlord48 2025-01-02 16:31:32 -05:00 committed by Nick Bolton
parent ba334d5411
commit 351c5123ef
4 changed files with 17 additions and 3 deletions

View file

@ -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

View file

@ -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();

View file

@ -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();

View file

@ -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, *))