Fix player brightness controls on iPhone Duo

Brightness controls used UIScreen.main, which on iPhone Duo can be a
different display than the one hosting the player. Route all brightness
reads and writes through PlayerBrightness, which targets the screen of
the window hosting the controls.
This commit is contained in:
Arkadiusz Fal
2026-10-22 23:16:11 +02:00
parent 52774fc7cc
commit fb4da41877
4 changed files with 52 additions and 9 deletions

View File

@@ -57,6 +57,10 @@ struct PlayerControlsActions {
/// behavior (details toggle, no rotate glyph, no orientation lock).
var canRotate: Bool = true
/// Screen of the window hosting the controls; brightness targets it
/// (iPhone Duo interior and exterior are separate screens).
var screen: UIScreen?
/// iPad, or an iPhone windowing mode that can't rotate on request.
var usesRotationFreeFullscreen: Bool { isIPad || !canRotate }