mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 14:22:02 +00:00
Fix macOS player window blink when playing a new video
The separate player window's show() restore branch reset alphaValue to 0 and faded back in even when the window was already on screen, so every Play Now while playing made the window flash. Only run the fade when the window was actually hidden (PiP restore); otherwise just bring it forward.
This commit is contained in:
@@ -49,6 +49,13 @@ final class ExpandedPlayerWindowManager: NSObject {
|
||||
func show(with appEnvironment: AppEnvironment, animated: Bool = true) {
|
||||
// If window already exists (hidden for PiP), restore it instead of creating new one
|
||||
if let existingWindow = playerWindow {
|
||||
// Already on screen (e.g. "Play Now" while playing) — just bring it
|
||||
// forward; resetting alphaValue here would make the window blink.
|
||||
if existingWindow.isVisible {
|
||||
LoggingService.shared.debug("ExpandedPlayerWindowManager: show() - window already visible, bringing to front", category: .player)
|
||||
existingWindow.makeKeyAndOrderFront(nil)
|
||||
return
|
||||
}
|
||||
LoggingService.shared.debug("ExpandedPlayerWindowManager: show() - restoring existing window (was hidden for PiP)", category: .player)
|
||||
if animated {
|
||||
existingWindow.alphaValue = 0
|
||||
|
||||
Reference in New Issue
Block a user