Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComposeWindow is shown before the first frame is rendered #3492

Closed
elijah-semyonov opened this issue Aug 14, 2023 · 16 comments · Fixed by JetBrains/compose-multiplatform-core#766
Assignees
Labels
bug Something isn't working ios performance rendering Low level rendering

Comments

@elijah-semyonov
Copy link
Contributor

elijah-semyonov commented Aug 14, 2023

Describe the bug
White flickering when presenting/pushing ComposeWindow

Affected platforms

  • iOS
  • Other

Versions
Latest master

Screen.Recording.2023-08-14.at.14.18.47.mov

Meta

Reported by Guilherme Delgado

@elijah-semyonov elijah-semyonov added bug Something isn't working rendering Low level rendering ios labels Aug 14, 2023
@elijah-semyonov elijah-semyonov self-assigned this Aug 14, 2023
@elijah-semyonov elijah-semyonov changed the title ComposeWindow is shown before first frame is rendered ComposeWindow is shown before the first frame is rendered Aug 14, 2023
@elijah-semyonov elijah-semyonov added the discussion Need further discussion to understand if it actually needed label Aug 14, 2023
@gastsail
Copy link

Hmm, could have to do with the navigation lib you are using?

@GuilhE
Copy link
Contributor

GuilhE commented Aug 21, 2023

Hmm, could have to do with the navigation lib you are using?

I don't think so, navigation is being made with NavigationStack on iOS side (no 3rd party).

@elijah-semyonov
Copy link
Contributor Author

We will add explicit wait for the first rendered frame to avoid this. I'll link related PR when it's done.

@elijah-semyonov elijah-semyonov removed the discussion Need further discussion to understand if it actually needed label Aug 22, 2023
@elijah-semyonov
Copy link
Contributor Author

Fixed in PR

@GuilhE
Copy link
Contributor

GuilhE commented Aug 29, 2023

@elijah-semyonov not deployed yet right?

@elijah-semyonov
Copy link
Contributor Author

elijah-semyonov commented Aug 30, 2023

Not yet, will be in next version.

@chrisbanes
Copy link

FYI, still seeing this in 1.5.1. Can we add an option to set the background color?

I don't think you'll ever be ever to guarantee that Compose goes through a whole draw pass before iOS does.

@GuilhE
Copy link
Contributor

GuilhE commented Sep 22, 2023

Yup tested again with:

gradleComposeMultiplatform = "1.5.1"
composeMultiplatformCompiler = "1.5.2-beta01"

And I can still see the white background.

@elijah-semyonov
Copy link
Contributor Author

@GuilhE
Could you please provide a repro? I agree with @chrisbanes that we can't guarantee that Compose goes through whole draw pass before iOS does, but I'm interested in particular chain of events, that bypass the fix.

@GuilhE
Copy link
Contributor

GuilhE commented Sep 22, 2023

@GuilhE Could you please provide a repro? I agree with @chrisbanes that we can't guarantee that Compose goes through whole draw pass before iOS does, but I'm interested in particular chain of events, that bypass the fix.

Yes of course, check it here https://github.com/GuilhE/Expressus

@elijah-semyonov
Copy link
Contributor Author

My bad, the fix is not live yet. Will be there in 1.5.10.

@GuilhE
Copy link
Contributor

GuilhE commented Sep 22, 2023

I can confirm that 1.5.10-beta01 fixes this problem

@GuilhE
Copy link
Contributor

GuilhE commented Sep 22, 2023

Updated also my sample if anyone want's a fast test candidate 😉

@chokokatana
Copy link

I'm hitting this problem avoiding SwiftUI using normal UIViewController classes. I even tried to force the background of the views to black before pushing them with pseudo code like this:

    val result = ComposeUIViewController {
        compose stuff
    }
    paintBlack(result.view)
    platform.vc.navigationController?.pushViewController(result, animated = true)

…

private fun paintBlack(v: UIView) {
    v.backgroundColor = WC.dark_main        
    for (child in v.subviews) paintBlack(child)
}

But that didn't work at all. Version 1.5.10-beta01 does fix the white flash for me during the controller animation.

@chrisbanes
Copy link

1.5.10-beta02 has fixed the issue for us. I didn’t try beta01 though so not sure if that contains the fix.

@GuilhE
Copy link
Contributor

GuilhE commented Oct 5, 2023

1.5.10-beta01 and beta02 fixed for me, no need for backgrounds hack, which btw, never managed to make it work 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ios performance rendering Low level rendering
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants