From 58c34250c579372effe871dc40062e9ae174b8f0 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 2 Jul 2026 22:24:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(iOS):=20replace=20lock=20overlay=20with=20a?= =?UTF-8?q?llowsHitTesting=20=E2=80=94=20icon=20now=20reliably=20unlocks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/MiniPlayerApp.swift | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Sources/MiniPlayerApp.swift b/Sources/MiniPlayerApp.swift index f114d1e..1b81167 100644 --- a/Sources/MiniPlayerApp.swift +++ b/Sources/MiniPlayerApp.swift @@ -398,6 +398,9 @@ struct PlayerContentView: View { #endif } .frame(maxWidth: .infinity, maxHeight: .infinity) + #if os(iOS) + .allowsHitTesting(!isLocked) + #endif .onTapGesture(count: 2) { #if os(iOS) recordInteraction() @@ -471,19 +474,6 @@ struct PlayerContentView: View { } ) - // iOS 锁屏遮罩层(拦截触摸,置于图标下方) - #if os(iOS) - if isLocked { - Color.black.opacity(0.01) - .ignoresSafeArea() - .allowsHitTesting(true) - .contentShape(Rectangle()) - .onTapGesture { - // 吞掉所有触摸 - } - } - #endif - // 底部控制栏 — 半透明,30秒自动隐藏 VStack { Spacer() @@ -505,6 +495,9 @@ struct PlayerContentView: View { if hovering { resetHideTimer() } } .transition(.move(edge: .bottom).combined(with: .opacity)) + #if os(iOS) + .allowsHitTesting(!isLocked) + #endif } } }