From 69e20c361756bb8039fdb8b1e8a6ccd074b7d2b8 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Tue, 02 Jun 2026 23:12:26 +0800
Subject: [PATCH] Add 7.8.10 App Store candidate DMG

---
 Apptag/ProcessSingleton.swift |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/Apptag/ProcessSingleton.swift b/Apptag/ProcessSingleton.swift
index cf8db77..c2111a2 100644
--- a/Apptag/ProcessSingleton.swift
+++ b/Apptag/ProcessSingleton.swift
@@ -6,6 +6,7 @@
     private static let lockURL = AppIdentity.applicationSupportDirectory
         .appendingPathComponent("TagLauncher.lock")
     private static let activationNotification = Notification.Name("TagLauncherExternalActivationRequested")
+    private static let duplicateLaunchSuppressReopenKey = "duplicateLaunchSuppressReopenAt"
 
     static func acquireOrHandOffAndExit() -> FileHandle {
         do {
@@ -31,7 +32,13 @@
     }
 
     private static func handOffAndExit() -> Never {
-        let shouldShowOverlay = !CommandLine.arguments.dropFirst().contains("--hide")
+        let arguments = CommandLine.arguments.dropFirst()
+        let shouldShowOverlay = arguments.contains("--show-overlay")
+        if !shouldShowOverlay {
+            UserDefaults.standard.set(Date().timeIntervalSince1970, forKey: duplicateLaunchSuppressReopenKey)
+            UserDefaults.standard.synchronize()
+            NSApplication.shared.setActivationPolicy(.accessory)
+        }
         let ownerInstance = NSRunningApplication
             .runningApplications(withBundleIdentifier: AppIdentity.bundleIdentifier)
             .filter { $0.processIdentifier != getpid() && !$0.isTerminated }

--
Gitblit v1.9.3