Is there a way to listen to focus changes of the w...
# compose-desktop
t
Is there a way to listen to focus changes of the window? I tried
Copy code
val windowInfo = LocalWindowInfo.current
LaunchedEffect(windowInfo) {
    snapshotFlow { windowInfo.isWindowFocused }
        .onEach { println(it) }
        .launchIn(this)
}
but it only prints
false
once and that's that.
i
windowInfo.isWindowFocused isn't implemented on desktop yet. You can use Swing interop to know if the window is in focus
t
I just spent an hour playing around with the SwingPanel and the top-level JFrame until I realized your comment had a link 🤦‍♂️ the notification did not show that... Yeah, works great! Now off to a more productive use of my time.. :D
🙃 1