[PR #667] Add support close-to-tray option #653

Open
opened 2026-02-28 14:33:46 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jpochyla/psst/pull/667
Author: @Cleboost
Created: 6/30/2025
Status: 🔄 Open

Base: mainHead: tray-option


📝 Commits (2)

  • 34b4870 Add Windows system tray support and close-to-tray option
  • 56c5f8b Merge branch 'main' into tray-option

📊 Changes

54 files changed (+780 additions, -1063 deletions)

View changed files

📝 .github/workflows/build.yml (+3 -2)
📝 Cargo.lock (+126 -219)
📝 psst-core/Cargo.toml (+1 -6)
📝 psst-core/build.rs (+4 -4)
📝 psst-core/src/actor.rs (+1 -1)
📝 psst-core/src/audio/decode.rs (+4 -4)
📝 psst-core/src/audio/output/cpal.rs (+5 -5)
📝 psst-core/src/cache.rs (+5 -5)
📝 psst-core/src/cdn.rs (+6 -7)
📝 psst-core/src/connection/mod.rs (+6 -6)
📝 psst-core/src/error.rs (+5 -13)
📝 psst-core/src/item_id.rs (+8 -14)
📝 psst-core/src/lib.rs (+0 -1)
📝 psst-core/src/oauth.rs (+10 -7)
📝 psst-core/src/player/file.rs (+4 -4)
📝 psst-core/src/player/item.rs (+4 -4)
📝 psst-core/src/player/mod.rs (+3 -3)
📝 psst-core/src/player/queue.rs (+7 -2)
📝 psst-core/src/player/worker.rs (+2 -2)
📝 psst-core/src/session/access_token.rs (+2 -1)

...and 34 more files

📄 Description

This pull request introduces several changes to enhance functionality, improve user experience, and add support for system tray integration on Windows. The most significant updates include adding new commands for playback control, implementing a system tray feature for Windows, and updating the configuration and preferences UI to support the new "close to tray" behavior.

I avoid using the module because of compatibility issues with GTK or other related problems.

  • Windows Support
  • Mac Support (can't test so hard to dev)
  • Linux Support

close https://github.com/jpochyla/psst/issues/294
close https://github.com/jpochyla/psst/issues/70
close https://github.com/jpochyla/psst/issues/389

Windows system tray integration:

  • Added WindowsTray struct in a new module windows_tray.rs to manage system tray functionality, including displaying a tray icon, handling right-click context menus, and responding to menu actions like playback control and application quit.
  • Updated Delegate to manage the system tray instance and handle commands related to the tray, such as TRAY_REMOVED and QUIT_APP_CLEAN. [1] [2] [3]
  • Added conditional compilation for Windows-specific tray functionality throughout the codebase. [1] [2]

Playback commands:

  • Introduced new selectors PLAY_PAUSE_TOGGLE and TRAY_REMOVED in cmd.rs to support toggling playback and handling tray removal events. [1] [2]
  • Updated playback.rs to handle the PLAY_PAUSE_TOGGLE command, allowing users to toggle between play and pause states.

Configuration updates:

  • Added a new close_to_tray field to the Config struct, enabling users to configure whether closing the app minimizes it to the system tray instead of quitting. [1] [2]
  • Updated the preferences UI in preferences.rs to include a checkbox for toggling the "close to tray" option.

Dependency updates:

  • Added winapi crate with necessary features to support Windows system tray functionality in Cargo.toml.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jpochyla/psst/pull/667 **Author:** [@Cleboost](https://github.com/Cleboost) **Created:** 6/30/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `tray-option` --- ### 📝 Commits (2) - [`34b4870`](https://github.com/jpochyla/psst/commit/34b4870a252a95c605af935a9d8f036d2e5867af) Add Windows system tray support and close-to-tray option - [`56c5f8b`](https://github.com/jpochyla/psst/commit/56c5f8bd542e7427c938166e1884277616bf3ca0) Merge branch 'main' into tray-option ### 📊 Changes **54 files changed** (+780 additions, -1063 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build.yml` (+3 -2) 📝 `Cargo.lock` (+126 -219) 📝 `psst-core/Cargo.toml` (+1 -6) 📝 `psst-core/build.rs` (+4 -4) 📝 `psst-core/src/actor.rs` (+1 -1) 📝 `psst-core/src/audio/decode.rs` (+4 -4) 📝 `psst-core/src/audio/output/cpal.rs` (+5 -5) 📝 `psst-core/src/cache.rs` (+5 -5) 📝 `psst-core/src/cdn.rs` (+6 -7) 📝 `psst-core/src/connection/mod.rs` (+6 -6) 📝 `psst-core/src/error.rs` (+5 -13) 📝 `psst-core/src/item_id.rs` (+8 -14) 📝 `psst-core/src/lib.rs` (+0 -1) 📝 `psst-core/src/oauth.rs` (+10 -7) 📝 `psst-core/src/player/file.rs` (+4 -4) 📝 `psst-core/src/player/item.rs` (+4 -4) 📝 `psst-core/src/player/mod.rs` (+3 -3) 📝 `psst-core/src/player/queue.rs` (+7 -2) 📝 `psst-core/src/player/worker.rs` (+2 -2) 📝 `psst-core/src/session/access_token.rs` (+2 -1) _...and 34 more files_ </details> ### 📄 Description This pull request introduces several changes to enhance functionality, improve user experience, and add support for system tray integration on Windows. The most significant updates include adding new commands for playback control, implementing a system tray feature for Windows, and updating the configuration and preferences UI to support the new "close to tray" behavior. I avoid using the module because of compatibility issues with GTK or other related problems. - [x] Windows Support - [ ] Mac Support (can't test so hard to dev) - [ ] Linux Support close https://github.com/jpochyla/psst/issues/294 close https://github.com/jpochyla/psst/issues/70 close https://github.com/jpochyla/psst/issues/389 ### Windows system tray integration: * Added `WindowsTray` struct in a new module `windows_tray.rs` to manage system tray functionality, including displaying a tray icon, handling right-click context menus, and responding to menu actions like playback control and application quit. * Updated `Delegate` to manage the system tray instance and handle commands related to the tray, such as `TRAY_REMOVED` and `QUIT_APP_CLEAN`. [[1]](diffhunk://#diff-c8f375f2a2899458767c8fb024b6984e965686f8e97f67ae9af60a9662eee0d5R1-L13) [[2]](diffhunk://#diff-c8f375f2a2899458767c8fb024b6984e965686f8e97f67ae9af60a9662eee0d5R198-R295) [[3]](diffhunk://#diff-c8f375f2a2899458767c8fb024b6984e965686f8e97f67ae9af60a9662eee0d5R315-R329) * Added conditional compilation for Windows-specific tray functionality throughout the codebase. [[1]](diffhunk://#diff-c8f375f2a2899458767c8fb024b6984e965686f8e97f67ae9af60a9662eee0d5R1-L13) [[2]](diffhunk://#diff-c8f375f2a2899458767c8fb024b6984e965686f8e97f67ae9af60a9662eee0d5R22-R57) ### Playback commands: * Introduced new selectors `PLAY_PAUSE_TOGGLE` and `TRAY_REMOVED` in `cmd.rs` to support toggling playback and handling tray removal events. [[1]](diffhunk://#diff-bdb6030edd2ded11d22984565295a2d9ce6bb79afeeff884046900306cf8e4f9R20-R21) [[2]](diffhunk://#diff-bdb6030edd2ded11d22984565295a2d9ce6bb79afeeff884046900306cf8e4f9R56) * Updated `playback.rs` to handle the `PLAY_PAUSE_TOGGLE` command, allowing users to toggle between play and pause states. ### Configuration updates: * Added a new `close_to_tray` field to the `Config` struct, enabling users to configure whether closing the app minimizes it to the system tray instead of quitting. [[1]](diffhunk://#diff-a29e959488757133612bf5960a708275f6ad8db38f4e83b8bca3ac8d0583e29dR119-R120) [[2]](diffhunk://#diff-a29e959488757133612bf5960a708275f6ad8db38f4e83b8bca3ac8d0583e29dR143-R144) * Updated the preferences UI in `preferences.rs` to include a checkbox for toggling the "close to tray" option. ### Dependency updates: * Added `winapi` crate with necessary features to support Windows system tray functionality in `Cargo.toml`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#653
No description provided.