Hi! Does anybody know if there a way to know when ...
# compose-desktop
y
Hi! Does anybody know if there a way to know when a Compose app is ready-to-use? I want to create a thread with a Compose app and use AWT Robot upon it, but I need to know when the app is fully loaded. So there's nothing to compose, re-compose or dispatch (input events, focus, something else). The same applies to the click. After it, I need to wait as long as UI responses.
Copy code
fun main() {
    val appReady: SomeNotifier

    thread(name = "ComposeApp") {
        singleWindowApplication {
            // My UI hierarchy ...
            }
        }
    }

    appReady.await()

    val robot = Robot()
    robot.click(x, y)
}
a
Only when running unit tests, but then there’s no real window to interact with.
You can probably hack something specific to your app/logic.
👍 1