WindowInfo


Provides information about the Window that is hosting this compose hierarchy.

Summary

Public properties

open DpSize

The size of the window represented as a DpSize that can used by the application in some way.

Cmn
open IntSize

The size of the window in pixels that can used by the application in some way.

Cmn
Boolean

Indicates whether the window hosting this compose hierarchy is in focus.

Cmn
open PointerKeyboardModifiers

Indicates the state of keyboard modifiers (pressed or not).

Cmn

Extension properties

Boolean

Whether cross-window blur is currently enabled by the system.

android

Public properties

containerDpSize

open val containerDpSizeDpSize

The size of the window represented as a DpSize that can used by the application in some way. Note that this may be a larger size than is available to the Compose hierarchy (if Compose does not fill the window). In addition, it may not be safe to display content using the entire window size, for example in situations where insets representing cutouts or obscuring system UI reduce the amount of available space. Even though all pixels included in this size may not be usable at any given time, it's relative stability means it is generally the correct signal to drive the overall layout structure displaying in the window.

containerSize

open val containerSizeIntSize

The size of the window in pixels that can used by the application in some way. Note that this may be a larger size than is available to the Compose hierarchy (if Compose does not fill the window). In addition, it may not be safe to display content using the entire window size, for example in situations where insets representing cutouts or obscuring system UI reduce the amount of available space. Even though all pixels included in this size may not be usable at any given time, it's relative stability means it is generally the correct signal to drive the overall layout structure displaying in the window.

isWindowFocused

val isWindowFocusedBoolean

Indicates whether the window hosting this compose hierarchy is in focus.

When there are multiple windows visible, either in a multi-window environment or if a popup or dialog is visible, this property can be used to determine if the current window is in focus.

keyboardModifiers

open val keyboardModifiersPointerKeyboardModifiers

Indicates the state of keyboard modifiers (pressed or not).

Extension properties

WindowInfo.isCrossWindowBlurEnabled

val WindowInfo.isCrossWindowBlurEnabledBoolean

Whether cross-window blur is currently enabled by the system.

Cross-window blur might not be supported by some devices due to GPU limitations. It can also be disabled at runtime (e.g., during battery saving mode, when multimedia tunneling is used, or when minimal post-processing is requested). In these situations, no blur is computed or drawn. Apps should check this flag to fall back to alternative styling (such as adjusting scrim opacity or changing themes) when blurs are disabled.

This affects both window blur behind (see android.view.WindowManager.LayoutParams.setBlurBehindRadius) and window background blur (see android.view.Window.setBackgroundBlurRadius).

On Android, this property queries android.view.WindowManager.isCrossWindowBlurEnabled on API 31+; on older API levels it always returns false.