From 3467b7205c48e49107d7540d2016661c1a3f632a Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 27 Mar 2022 13:42:38 +0200 Subject: [PATCH] Fix player window on Mac --- macOS/Windows.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/macOS/Windows.swift b/macOS/Windows.swift index c9901ffc..06eb4ec9 100644 --- a/macOS/Windows.swift +++ b/macOS/Windows.swift @@ -33,7 +33,11 @@ enum Windows: String, CaseIterable { func open() { switch self { case .player: - NSWorkspace.shared.open(URL(string: "yattee://\(location)")!) + if let window = Self.playerWindow { + window.makeKeyAndOrderFront(self) + } else { + NSWorkspace.shared.open(URL(string: "yattee://\(location)")!) + } case .main: Self.main.focus() }