🐛 [iOS] Present the camera from a dedicated window by default - #639
Open
PierreVieira wants to merge 1 commit into
Open
🐛 [iOS] Present the camera from a dedicated window by default#639PierreVieira wants to merge 1 commit into
PierreVieira wants to merge 1 commit into
Conversation
PierreVieira
force-pushed
the
fix/camera-default-presenter-window
branch
from
August 11, 2026 21:29
12879e1 to
2f11f30
Compare
When no explicit presenter is supplied, openCameraPicker used to present the fullscreen UIImagePickerController from the top-most view controller of the main window. Hosts whose dialogs live in their own UIWindow above modal view controllers — Compose Multiplatform since 1.11 — end up with the camera presented underneath that dialog window, which corrupts touch handling app-wide after the picker dismissal (vinceglb#638). The camera presentation is now hosted in a FileKit-managed transparent UIWindow made key above alerts, attached right before presenting and detached — restoring the previous key window — once the capture flow finishes, including failure paths. Apps passing an explicit presenter through FileKitOpenCameraSettings keep the previous behavior.
PierreVieira
force-pushed
the
fix/camera-default-presenter-window
branch
from
August 11, 2026 21:36
2f11f30 to
eca703c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #638.
Problem
When no explicit presenter is supplied,
openCameraPickerpresents the in-process fullscreenUIImagePickerControllerfromtopMostViewController()— i.e. in the app's main window. Hosts whose dialogs live in their ownUIWindowabove modal view controllers — Compose Multiplatform since 1.11 (JetBrains/compose-multiplatform-core#2270, CMP-9772) — end up with the camera presented underneath the dialog window. After the picker dismissal, touch handling is corrupted app-wide: every tap shows the press indication but never completes a click, until process restart. The gallery path never hits this becausePHPickerViewControlleris out-of-process.The deliver-after-dismissal fix from #619 is necessary but not sufficient here: the corruption comes from the presentation itself happening below the dialog window.
Fix
CameraPresenterWindowhosts the camera presentation in a FileKit-managed transparentUIWindow: created on the active scene, made key aboveUIWindowLevelAlert, attached right before presenting, and detached — restoring the previous key window — once the capture flow finishes. Thetry/finallycovers every exit: photo delivered, cancellation, andprepareAppleCameraPresentationfailures (camera unavailable, requested facing unavailable).Apps passing an explicit presenter through
FileKitOpenCameraSettings(presenter = ...)keep the exact previous behavior — the managed window is only created whenpresenteris null. This matches the JetBrains-recommended pattern of presenting native modals from an app-managed window when CMP dialog windows are involved.Testing
:filekit-dialogs:compileKotlinIosSimulatorArm64and:filekit-dialogs:iosSimulatorArm64Testpass. The dedicated-window presentation recipe itself is confirmed on a physical iPhone 15 (iOS 17, Compose Multiplatform 1.11.1): an equivalent implementation applied throughFileKitOpenCameraSettings(presenter = ...)in our app fully resolves the touch corruption described in #638, with the camera, cancellation and error paths all restoring the previous key window correctly.