From 57abfdc2ba880be1fae4a1a184531e3228d62dae Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Tue, 19 May 2026 01:20:21 +0800
Subject: [PATCH] Prepare App Store release 7.3.5 build 744

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

diff --git a/Apptag/ApptagApp.swift b/Apptag/ApptagApp.swift
index 3737c9b..72a1665 100644
--- a/Apptag/ApptagApp.swift
+++ b/Apptag/ApptagApp.swift
@@ -586,6 +586,7 @@
         }
         overlayWindow?.orderOut(nil)
         removeOverlayKeyMonitor()
+        NotificationCenter.default.post(name: .tagLauncherOverlayDidHide, object: nil)
         if force {
             overlayWindow = nil
         }
@@ -836,15 +837,25 @@
 
 final class DismissibleHostingView<Content: View>: NSHostingView<Content> {
     private let onBackdropTap: () -> Void
+    private var suppressBackdropDismiss = false
+    private var modalInteractionObserver: NSObjectProtocol?
 
     @MainActor required init(rootView: Content) {
         self.onBackdropTap = {}
         super.init(rootView: rootView)
+        observeModalInteractionChanges()
     }
 
     init(rootView: Content, onBackdropTap: @escaping () -> Void) {
         self.onBackdropTap = onBackdropTap
         super.init(rootView: rootView)
+        observeModalInteractionChanges()
+    }
+
+    deinit {
+        if let modalInteractionObserver {
+            NotificationCenter.default.removeObserver(modalInteractionObserver)
+        }
     }
 
     @available(*, unavailable)
@@ -857,6 +868,10 @@
             return
         }
         if hit == self {
+            if suppressBackdropDismiss {
+                super.mouseDown(with: event)
+                return
+            }
             onBackdropTap()
             return
         }
@@ -879,6 +894,16 @@
         super.mouseDown(with: event)
     }
 
+    private func observeModalInteractionChanges() {
+        modalInteractionObserver = NotificationCenter.default.addObserver(
+            forName: .tagLauncherModalInteractionChanged,
+            object: nil,
+            queue: .main
+        ) { [weak self] notification in
+            self?.suppressBackdropDismiss = (notification.userInfo?["active"] as? Bool) ?? false
+        }
+    }
+
     private func findTextFieldContainer(in view: NSView) -> TextFieldContainer? {
         if let container = view as? TextFieldContainer { return container }
         for sub in view.subviews {

--
Gitblit v1.9.3