From 554dce57269e2ae24f5de9c39972cacbc0a350dc Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Tue, 19 May 2026 03:03:21 +0800
Subject: [PATCH] Fix stale app hover bubbles

---
 Apptag/ContentView.swift |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/Apptag/ContentView.swift b/Apptag/ContentView.swift
index fd8ffa8..b9bb245 100644
--- a/Apptag/ContentView.swift
+++ b/Apptag/ContentView.swift
@@ -1873,15 +1873,21 @@
         notchHeight = activeScreen?.safeAreaInsets.top ?? 0
     }
 
-    private func handleBubbleHover(app: AppInfo, frame: CGRect, hovering: Bool) {
+    private func handleBubbleHover(app: AppInfo, frame: CGRect, event: AppBubbleHoverEvent) {
         guard !appBubbleDisabled else {
             clearAppBubbleState()
             return
         }
         guard editingBubble == nil else { return }
-        if hovering {
-            hoveredBubble = AppBubbleContext(app: app, frame: frame)
-        } else if hoveredBubble?.app.path == app.path {
+        switch event {
+        case .entered(let canShowBubble):
+            if canShowBubble {
+                hoveredBubble = AppBubbleContext(app: app, frame: frame)
+            } else {
+                hoveredBubble = nil
+            }
+        case .exited:
+            guard hoveredBubble?.app.path == app.path else { return }
             hoveredBubble = nil
         }
     }

--
Gitblit v1.9.3