From e94ff861c7cd6939133763c835b5b8aa4b638581 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Thu, 4 Jun 2026 18:27:29 +0200 Subject: [PATCH] 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. --- Yattee/Views/Player/ExpandedPlayerWindowManager.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Yattee/Views/Player/ExpandedPlayerWindowManager.swift b/Yattee/Views/Player/ExpandedPlayerWindowManager.swift index ebe78c52..4e9208af 100644 --- a/Yattee/Views/Player/ExpandedPlayerWindowManager.swift +++ b/Yattee/Views/Player/ExpandedPlayerWindowManager.swift @@ -475,6 +475,10 @@ extension ExpandedPlayerWindowManager: NSWindowDelegate { // Clear reference first so hide() becomes a no-op 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 // The player must be stopped while views still exist to ensure // proper cleanup of render resources