From 5f53e53c7a0645aa899c9ef39912da2a9f539c8a Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 22 Nov 2025 20:11:14 +0100 Subject: [PATCH] Fix iOS fullscreen gesture collision with notification center In fullscreen playback, swipe-down and timeline seek gestures now respect a 60pt safe zone at the top of the screen, allowing the system notification center gesture to work without triggering app gestures. --- Shared/Constants.swift | 1 + Shared/Player/Controls/TimelineView.swift | 10 ++++++++++ Shared/Player/PlayerDragGesture.swift | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/Shared/Constants.swift b/Shared/Constants.swift index 399a5896..4184073e 100644 --- a/Shared/Constants.swift +++ b/Shared/Constants.swift @@ -6,6 +6,7 @@ enum Constants { static let overlayAnimation = Animation.linear(duration: 0.2) static let aspectRatio16x9 = 16.0 / 9.0 static let aspectRatio4x3 = 4.0 / 3.0 + static let notificationCenterZoneHeight: Double = 60 static var isAppleTV: Bool { #if os(iOS) diff --git a/Shared/Player/Controls/TimelineView.swift b/Shared/Player/Controls/TimelineView.swift index 5a0b291a..3938002d 100644 --- a/Shared/Player/Controls/TimelineView.swift +++ b/Shared/Player/Controls/TimelineView.swift @@ -199,6 +199,16 @@ struct TimelineView: View { .gesture( DragGesture(minimumDistance: 5, coordinateSpace: .global) .onChanged { value in + #if os(iOS) + // In fullscreen, ignore gestures that start in the top notification center area + // to allow system notification center gesture to work + if player.playingFullScreen { + if value.startLocation.y < Constants.notificationCenterZoneHeight { + return + } + } + #endif + if !dragging { controls.removeTimer() draggedFrom = current diff --git a/Shared/Player/PlayerDragGesture.swift b/Shared/Player/PlayerDragGesture.swift index 696bd630..c6832fe2 100644 --- a/Shared/Player/PlayerDragGesture.swift +++ b/Shared/Player/PlayerDragGesture.swift @@ -16,6 +16,16 @@ extension VideoPlayerView { state = true } .onChanged { value in + #if os(iOS) + // In fullscreen, ignore gestures that start in the top notification center area + // to allow system notification center gesture to work + if player.playingFullScreen { + if value.startLocation.y < Constants.notificationCenterZoneHeight { + return + } + } + #endif + guard player.presentingPlayer, !controlsOverlayModel.presenting, dragGestureState,