State of Compose 2023 results are in! Click here to learn more

← Back to Compose UI

WindowFocusObserver

Component
in
Compose UI
. Since 1.0.0-alpha08

Overview

Code Examples

Provides a callback that is called whenever the window gains or loses focus.

Overloads

WindowFocusObserver

@Deprecated(
    message = "Use AmbientWindowInfo.current.isWIndowFocused instead.",
    level = DeprecationLevel.ERROR
)
@Composable
fun WindowFocusObserver(onWindowFocusChanged: (isWindowFocused: Boolean) -> Unit)