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 "platform/wayland.h"
#if defined(Q_OS_MAC)
#include "gui/OSXHelpers.h"
#endif
#if defined(Q_OS_LINUX)
#include "config.h"
#endif

View file

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

View file

@ -31,4 +31,5 @@ bool isOSXDevelopmentBuild();
bool showOSXNotification(const QString &title, const QString &body);
bool isOSXInterfaceStyleDark();
void forceAppActive();
void macOSNativeHide();
IconsTheme getOSXIconsTheme();

View file

@ -112,6 +112,11 @@ void forceAppActive()
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
}
void macOSNativeHide()
{
[NSApp hide:nil];
}
IconsTheme getOSXIconsTheme()
{
if (@available(macOS 11, *))