fix: acknowledge each legacy tip once per cleanup intent

This commit is contained in:
阿白叔 committed 2026-11-17 11:33:49 +08:00
1 parent 701e5cd3b4
commit 8818fa9841
3 files changed
+48 -16

No files matched your search

+6 -3
View File
@@ -698,7 +698,7 @@ def _close_registered_startup(row, handle, proof, *, stop=None):
if not active_owner() or time.monotonic() >= deadline:
raise ValueError('STARTUP_ACTION_UNCONFIRMED')
_post_window_message({'desktop':job['desktop']}, hwnd, row['pid'], message)
state = {'clicked':set()}; closed = proof['closed_frame']
state = {'clicked':set()}; closed = proof['closed_frame']; dismissed_tips = set()
try:
while time.monotonic() < deadline:
if win32event.WaitForSingleObject(handle, 0) == win32con.WAIT_OBJECT_0:
@@ -712,8 +712,11 @@ def _close_registered_startup(row, handle, proof, *, stop=None):
if closed is not None:
tip_row['startup_frame'] = closed
has_tip = any(w['title'] == 'Tip of the Day' for w in snapshot.get(row['pid'],[]))
if has_tip and confirmed() and _dismiss_startup_tip(tip_row,handle,snapshot.get(row['pid'],[]),
incomplete=_window_error(snapshot,row['pid']),deadline=deadline,stop=stop) is not None:
tip = (_dismiss_startup_tip(tip_row,handle,snapshot.get(row['pid'],[]),
incomplete=_window_error(snapshot,row['pid']),dismissed=dismissed_tips,deadline=deadline,stop=stop)
if has_tip and confirmed() else None)
if tip is not None:
dismissed_tips.add(tip)
if closed is None:
continue # Tip may precede loading; the same intent still owns its one Close.
while time.monotonic() < deadline: