From 0258b3eae7b09beed0f2b6cc70e76d8627a19615 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Mon, 25 May 2026 00:20:14 +0800
Subject: [PATCH] Keep fullscreen secondary windows in current Space

---
 Apptag/ApptagApp.swift |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Apptag/ApptagApp.swift b/Apptag/ApptagApp.swift
index 214816c..81eca50 100644
--- a/Apptag/ApptagApp.swift
+++ b/Apptag/ApptagApp.swift
@@ -949,8 +949,6 @@
         for startIndex in tallWindows.indices {
             var union = tallWindows[startIndex].frame
             var lastMaxX = union.maxX
-            var distinctOwners = Swift.Set<String>()
-            distinctOwners.insert(tallWindows[startIndex].owner)
 
             for window in tallWindows.dropFirst(startIndex + 1) {
                 let gap = window.frame.minX - lastMaxX
@@ -959,13 +957,12 @@
                 }
                 union = union.union(window.frame)
                 lastMaxX = max(lastMaxX, window.frame.maxX)
-                distinctOwners.insert(window.owner)
 
                 let touchesLeft = abs(union.minX - screenFrame.minX) <= 32
                 let touchesRight = abs(union.maxX - screenFrame.maxX) <= 32
                 let coversWidth = union.width >= screenFrame.width * 0.92
                 let coversHeight = union.height >= screenFrame.height * 0.86
-                if distinctOwners.count >= 2 && touchesLeft && touchesRight && coversWidth && coversHeight {
+                if touchesLeft && touchesRight && coversWidth && coversHeight {
                     return true
                 }
             }
@@ -1432,7 +1429,10 @@
             let preferredScreen = self.overlayWindow?.screen
             self.detachSettingsWindow(closingWindow)
             self.settingsWindow = nil
-            self.refreshLauncherChromeState(activate: shouldRefocusOverlay)
+            self.refreshLauncherChromeState(
+                activate: shouldRefocusOverlay && !self.overlayAvoidsSpaceSwitch,
+                avoidSpaceSwitch: self.overlayAvoidsSpaceSwitch
+            )
             guard shouldRefocusOverlay else { return }
             DispatchQueue.main.asyncAfter(deadline: .now() + 0.12) { [weak self] in
                 self?.showOrFocusOverlay(preferredScreen: preferredScreen)

--
Gitblit v1.9.3