From 70d6386c00d46b8be43691756a60849f07dba879 Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Fri, 2 Aug 2024 10:45:40 +0200 Subject: [PATCH] Fix window will close notification, making sure it's from our window --- App/App_macOS.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/App/App_macOS.swift b/App/App_macOS.swift index ca85071e2..0518cd20a 100644 --- a/App/App_macOS.swift +++ b/App/App_macOS.swift @@ -190,7 +190,12 @@ struct RootView: View { navigation.currentItem = .reading browser.load(url: url) } - .onReceive(tabCloses) { _ in + .onReceive(tabCloses) { publisher in + guard windowTracker.current == publisher.object as? NSWindow else { + // when exiting full screen video, we get the same notification + // but that's not comming from our window + return + } guard !navigation.isTerminating else { // tab closed by app termination return