[feat] support minimizing to the system tray on macOS when closing, refs #87

This commit is contained in:
dijunkun
2026-06-23 00:39:44 +08:00
parent 009699b375
commit e026491b9f
8 changed files with 334 additions and 19 deletions
+5
View File
@@ -39,6 +39,8 @@
#if _WIN32
#include "win_tray.h"
#elif defined(__APPLE__)
#include "mac_tray.h"
#endif
namespace crossdesk {
@@ -414,6 +416,7 @@ class Render {
int AudioDeviceInit();
int AudioDeviceDestroy();
void HandleWindowsServiceIntegration();
bool MinimizeMainWindowToTray();
#if _WIN32
void ResetLocalWindowsServiceState(bool clear_pending_sas);
#if CROSSDESK_PORTABLE
@@ -510,6 +513,8 @@ class Render {
const int sdl_refresh_ms_ = 16; // ~60 FPS
#if _WIN32
std::unique_ptr<WinTray> tray_;
#elif defined(__APPLE__)
std::unique_ptr<MacTray> tray_;
#endif
// main window properties