mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 14:52:03 +00:00
Fix stale queue after closing macOS player window with Cmd+W
Closing the separate player window via Cmd+W (or the traffic-light button) stopped the player but left the queue populated, so the next video tap showed the Play Now/Play Next/Add to Queue prompt. Clear the queue in windowShouldClose to match the close button behavior.
This commit is contained in:
@@ -475,6 +475,10 @@ extension ExpandedPlayerWindowManager: NSWindowDelegate {
|
|||||||
// Clear reference first so hide() becomes a no-op
|
// Clear reference first so hide() becomes a no-op
|
||||||
playerWindow = nil
|
playerWindow = nil
|
||||||
|
|
||||||
|
// Clear queue so closing the window fully ends the session,
|
||||||
|
// matching the close button behavior
|
||||||
|
appEnvironment?.queueManager.clearQueue()
|
||||||
|
|
||||||
// Stop player BEFORE cleaning up window to avoid crash
|
// Stop player BEFORE cleaning up window to avoid crash
|
||||||
// The player must be stopped while views still exist to ensure
|
// The player must be stopped while views still exist to ensure
|
||||||
// proper cleanup of render resources
|
// proper cleanup of render resources
|
||||||
|
|||||||
Reference in New Issue
Block a user