Pointer Lock API does not work when Fullscreen API is enabled. You can see this in PWA apps that have been added to the dock from safari or normal safari web applications. Games use both fullscreen and pointer lock to function. Not having both at the same time is an issue. You can try this with geforce now and Xbox cloud gaming on safari, without a PWA installation: 1. Disable fullscreen API in the feature flags. 2. Go to https://play.geforcenow.com/mall/ and play a game like Fortnite. - You will see you can use the mouse to click on the game UI and even look around when playing. 3. Re-enable the Fullscreen API in feature flags. Then quit and re open safari to make sure the changes apply. 4. Next go to https://www.xbox.com/en-us/play and play Fortnite. - You will see the mouse can no longer be used to interact with the Ul. The mouse can also not be locked to moving around when playing a match. - Note 1: You could also test this with GeForce now in Fullscreen mode, but for some reason even with the API enabled the game does not consistently launch in Fullscreen. This is why I have you try it with Xbox cloud gaming. - Note 2: You could also test this by adding one of the website to the dock as a PWA installation. PWA always launch in Fullscreen mode.
<rdar://problem/125924062>
@Jeffrey, what macOS/Safari version are you using?
(In reply to Abrar Rahman Protyasha from comment #2) > @Jeffrey, what macOS/Safari version are you using? I am using Safari Technology Preview 191. Although this happens on at least Safari 17.3 and newer as this bug is present on those versions as well.
Created attachment 470759 [details] Video of the Bug I have attached a video of the bug that shows the difference in Pointer Lock API when in fullscreen and when not in fullscreen.
Thanks for the repro video. CC-ing broadly for comments.
Still happens on Safari Technology Preview 192. I even turned on the new "Pointer Lock Options" Feature Flag.
Yes, that's expected since no changes have been made to address this yet, thanks for checking though! FYI, the pointer lock options feature flag was about exposing unadjusted movement values: https://developer.mozilla.org/en-US/docs/Web/API/Element/requestPointerLock#unadjustedmovement
Yes, just figured I would update on updates. Good to see the unadjusted movements supported in Safari! Hoping to potentially see it and the other pointer lock API options on iPadOS, iOS, and visionOS sometime after itβs out of testing.
Created attachment 471262 [details] Test case for the ponter lock with full screen API
Created attachment 471324 [details] Pointer Lock Test after Full Screen Mode
Added more simplified test case for pointer lock API testing after entering the Full Screen mode. This works fine with webkit mini browser as well as chrome browser.
Adding that this bug has to be new to macOS safari 17.5 as I have a video of pointer Lock API working in fullscreen API dated February 19, 2024. At the time of the video I was running macOS developer beta 14.4 beta 3. I was using the normal safari app and not STP. Now with macOS 14.5 the bug happens in the normal safari app as well as STP. I was using this website in the video https://app.3daimtrainer.com/play I can attach the video of it working perfectly fine with macOS 14.4 if needed. Safe to say this bug is from safari for macOS 14.4 developer beta 4 or newer, but I am assuming it was safari 17.5 that brought the bug from STP to normal safari. I would have to downgrade to confirm, but this means safari 17.4 and macOS 14.4 should not have this bug. Or at least safari 17.3 or macOS 14.3 should not have this bug.
Created attachment 471611 [details] Screen recording on Safari 17.1 (non-repo)
Adding screen recording on previous version of safari (17.1) and it worked well.