Skip to content

Comments

Fix first frame rendering#2683

Merged
ASalavei merged 1 commit intojb-mainfrom
andrei.salavei/fix-first-frame-display
Jan 16, 2026
Merged

Fix first frame rendering#2683
ASalavei merged 1 commit intojb-mainfrom
andrei.salavei/fix-first-frame-display

Conversation

@ASalavei
Copy link

As we were relying on didMoveToWindow() and layoutSubviews() to configure components, MetalLayer may receive a call to layoutSubviews() and, consequently, fire a draw call before the ComposeSceneMediator is properly initialised. Moving the synchronous frame draw to the drawRect fixes the issue. Note: drawRect does not work when used in MetalView (a view that uses CAMetalLayer).

Fixes https://youtrack.jetbrains.com/issue/CMP-9471/iOS-Flash-on-toggling-between-views

Release Notes

Fixes - iOS

  • Fix issue where the first frame may not be rendered on Compose container appearance

@ASalavei ASalavei merged commit 30db352 into jb-main Jan 16, 2026
18 checks passed
@ASalavei ASalavei deleted the andrei.salavei/fix-first-frame-display branch January 16, 2026 16:04
ASalavei added a commit that referenced this pull request Jan 16, 2026
As we were relying on `didMoveToWindow()` and `layoutSubviews()` to
configure components, MetalLayer may receive a call to
`layoutSubviews()` and, consequently, fire a draw call before the
ComposeSceneMediator is properly initialised. Moving the synchronous
frame draw to the `drawRect` fixes the issue. Note: `drawRect` does not
work when used in `MetalView` (a view that uses `CAMetalLayer`).

Fixes
https://youtrack.jetbrains.com/issue/CMP-9471/iOS-Flash-on-toggling-between-views

## Release Notes
### Fixes - iOS
- Fix issue where the first frame may not be rendered on Compose
container appearance
siarb added a commit that referenced this pull request Jan 19, 2026
As we were relying on `didMoveToWindow()` and `layoutSubviews()` to
configure components, MetalLayer may receive a call to
`layoutSubviews()` and, consequently, fire a draw call before the
ComposeSceneMediator is properly initialised. Moving the synchronous
frame draw to the `drawRect` fixes the issue. Note: `drawRect` does not
work when used in `MetalView` (a view that uses `CAMetalLayer`).

Fixes

https://youtrack.jetbrains.com/issue/CMP-9471/iOS-Flash-on-toggling-between-views

## Release Notes
### Fixes - iOS
- Fix issue where the first frame may not be rendered on Compose
container appearance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants