# PopupProperties

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/window/+class:androidx.compose.ui.window.PopupProperties) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class PopupProperties
  ```

*** ** * ** ***

Properties used to customize the behavior of a `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/Popup.composable#Popup(androidx.compose.ui.Alignment,androidx.compose.ui.unit.IntOffset,kotlin.Function0,androidx.compose.ui.window.PopupProperties,kotlin.Function0)`.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#PopupProperties(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean)( focusable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnBackPress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnClickOutside: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, clippingEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, usePlatformDefaultWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#PopupProperties(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.window.SecureFlagPolicy,kotlin.Boolean,kotlin.Boolean)( focusable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnBackPress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnClickOutside: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, securePolicy: https://developer.android.com/reference/kotlin/androidx/compose/ui/window/SecureFlagPolicy, excludeFromSystemGesture: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, clippingEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#PopupProperties(kotlin.Int,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Int,android.os.IBinder,androidx.compose.ui.unit.Dp,kotlin.Float)( flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, inheritSecurePolicy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnBackPress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnClickOutside: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, excludeFromSystemGesture: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, usePlatformDefaultWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, windowType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, windowToken: https://developer.android.com/reference/android/os/IBinder.html?, blurBehindRadius: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, scrimAlpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#PopupProperties(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.window.SecureFlagPolicy,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Int,android.os.IBinder,androidx.compose.ui.unit.Dp,kotlin.Float)( focusable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnBackPress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, dismissOnClickOutside: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, securePolicy: https://developer.android.com/reference/kotlin/androidx/compose/ui/window/SecureFlagPolicy, excludeFromSystemGesture: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, clippingEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, usePlatformDefaultWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, windowType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, windowToken: https://developer.android.com/reference/android/os/IBinder.html?, blurBehindRadius: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp, scrimAlpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Constructs a `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties` with the given behaviors. | android |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#hashCode()()` | android |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#blurBehindRadius()` Blurs the screen behind the window. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#clippingEnabled()` Whether to allow the popup window to extend beyond the bounds of the screen. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#dismissOnBackPress()` Whether the popup can be dismissed by pressing the back or escape buttons on Android or the escape key on desktop. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#dismissOnClickOutside()` Whether the popup can be dismissed by clicking outside the popup's bounds. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#excludeFromSystemGesture()` A flag to check whether to set the systemGestureExclusionRects. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#focusable()` Whether the popup is focusable. | Cmn android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#scrimAlpha()` The opacity of the scrim (also known as dimming) applied behind the popup window. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/SecureFlagPolicy` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#securePolicy()` Policy for how `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE` is set on the popup's window. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#usePlatformDefaultWidth()` Whether the width of the popup's content should be limited to the platform default, which is smaller than the screen width. | Cmn android |
| `https://developer.android.com/reference/android/os/IBinder.html?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#windowToken()` An optional `https://developer.android.com/reference/android/os/IBinder.html` to be used as the window token for the popup window. | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#windowType()` An optional `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#type` for the popup window. | android |

## Public constructors

### PopupProperties

Cmn android Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
PopupProperties(
    focusable: Boolean = false,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    clippingEnabled: Boolean = true,
    usePlatformDefaultWidth: Boolean = false
)
```

### PopupProperties

android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
PopupProperties(
    focusable: Boolean = false,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    excludeFromSystemGesture: Boolean = true,
    clippingEnabled: Boolean = true
)
```

### PopupProperties

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
PopupProperties(
    flags: Int,
    inheritSecurePolicy: Boolean = true,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    excludeFromSystemGesture: Boolean = true,
    usePlatformDefaultWidth: Boolean = false,
    windowType: Int = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL,
    windowToken: IBinder? = null,
    blurBehindRadius: Dp = Dp.Unspecified,
    scrimAlpha: Float = Float.NaN
)
```

### PopupProperties

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
PopupProperties(
    focusable: Boolean = false,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    excludeFromSystemGesture: Boolean = true,
    clippingEnabled: Boolean = true,
    usePlatformDefaultWidth: Boolean = false,
    windowType: Int = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL,
    windowToken: IBinder? = null,
    blurBehindRadius: Dp = Dp.Unspecified,
    scrimAlpha: Float = Float.NaN
)
```

Constructs a `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties` with the given behaviors. This constructor is to support multiplatform and maintain backwards compatibility. Consider the overload that takes a `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#flags()` parameter if more precise control over the popup flags is desired.

```kotlin
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.PopupProperties

// In a real Service scenario, appWindowToken would be received via IPC
// from the main application process. This sample simulates having the token.
val appWindowToken: IBinder? = null // Provided via IPC

var showPopup by remember { mutableStateOf(false) }

Button(onClick = { showPopup = true }) { Text("Show Popup From Service") }

if (showPopup) {
    Popup(
        onDismissRequest = { showPopup = false },
        properties =
            PopupProperties(
                // Pass the application's window token
                windowToken = appWindowToken
            ),
    ) {
        Box(Modifier.size(200.dp, 100.dp).background(Color.Blue.copy(alpha = 0.8f))) {
            Text("Popup Content (Service)", color = Color.White)
        }
    }
}
```

| Parameters |
|---|---|
| `focusable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | Whether the popup is focusable. When true, the popup will receive IME events and key presses, such as when the back button is pressed. |
| `dismissOnBackPress: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | Whether the popup can be dismissed by pressing the back or escape buttons. If true, pressing the back or escape buttons will call onDismissRequest. Note that `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.window.SecureFlagPolicy,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Int,android.os.IBinder,androidx.compose.ui.unit.Dp,kotlin.Float)` must be set to true in order to receive key events such as the back button. If the popup is not focusable, then this property does nothing. |
| `dismissOnClickOutside: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | Whether the popup can be dismissed by clicking outside the popup's bounds. If true, clicking outside the popup will call onDismissRequest. |
| `securePolicy: https://developer.android.com/reference/kotlin/androidx/compose/ui/window/SecureFlagPolicy = SecureFlagPolicy.Inherit` | Policy for setting `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE` on the popup's window. |
| `excludeFromSystemGesture: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | A flag to check whether to set the systemGestureExclusionRects. The default is true. |
| `clippingEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = true` | Whether to allow the popup window to extend beyond the bounds of the screen. By default the window is clipped to the screen boundaries. Setting this to false will allow windows to be accurately positioned. The default value is true. |
| `usePlatformDefaultWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | Whether the width of the popup's content should be limited to the platform default, which is smaller than the screen width. |
| `windowType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL` | An optional `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#type` for the popup window. Defaults to `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#TYPE_APPLICATION_SUB_PANEL`. Overriding this allows you to change the layer or behavior of the popup. For example, setting it to `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#TYPE_APPLICATION_OVERLAY` can be used to display a popup on top of all other applications (which requires the `https://developer.android.com/reference/android/Manifest.permission.html#SYSTEM_ALERT_WINDOW` permission). Note: If you are displaying a popup from a non-Activity context (such as an `https://developer.android.com/reference/android/app/Service.html`) but still want it to be anchored to an existing application window, you should leave this as the default sub-panel type and instead provide the `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.window.SecureFlagPolicy,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Int,android.os.IBinder,androidx.compose.ui.unit.Dp,kotlin.Float)` of the target application window. |
| `windowToken: https://developer.android.com/reference/android/os/IBinder.html? = null` | An optional `https://developer.android.com/reference/android/os/IBinder.html` to be used as the window token for the popup window. In most cases, this can be left null, and the popup will use the token from the hosting Compose view (`https://developer.android.com/reference/android/view/View.html#getApplicationWindowToken()`). However, this parameter is essential for cross-process scenarios. For instance, if a Service running in a different process needs to display a popup anchored to a window in the main application process, the main application's window token must be provided here. The provided token must be a valid`https://developer.android.com/reference/android/os/IBinder.html` from an existing window and must have the necessary permissions to add sub-windows of the specified`https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.window.SecureFlagPolicy,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Int,android.os.IBinder,androidx.compose.ui.unit.Dp,kotlin.Float)`. Providing an invalid, stale, or permission-denied token will typically result in an `https://developer.android.com/reference/android/view/WindowManager.BadTokenException.html` when the popup attempts to show. |
| `blurBehindRadius: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = Dp.Unspecified` | Blurs the screen behind the window. The effect is similar to that of `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#(kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.window.SecureFlagPolicy,kotlin.Boolean,kotlin.Boolean,kotlin.Boolean,kotlin.Int,android.os.IBinder,androidx.compose.ui.unit.Dp,kotlin.Float)`, but instead of having a scrim applied, the content behind the window will be blurred (or combined with the scrim opacity, if such is specified). The density of the blur is set by the blur radius. The radius defines the size of the neighboring area, from which pixels will be averaged to form the final color for each pixel. The operation approximates a Gaussian blur. A radius of `0.dp` means no blur. The higher the radius, the denser the blur. Some devices might not support cross-window blur due to GPU limitations. It can also be disabled by the system at runtime (e.g. during battery saving mode). In such situations, no blur will be computed or drawn. Supported on Android 12 (`https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#S`) and above. |
| `scrimAlpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = Float.NaN` | The opacity of the scrim (also known as dimming) applied behind the popup window. Ranging from 0.0f (no scrim) to 1.0f (completely opaque). By default, this value is `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html`, which means the popup retains the standard system popup behavior with no scrim applied behind the window. Example usage: |

## Public functions

### equals

android

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

android

```
open fun hashCode(): Int
```

## Public properties

### blurBehindRadius

android

```
val blurBehindRadius: Dp
```

Blurs the screen behind the window. The effect is similar to that of `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#scrimAlpha()`, but instead of having a scrim applied, the content behind the window will be blurred (or combined with the scrim opacity, if such is specified). The density of the blur is set by the blur radius. The radius defines the size of the neighboring area, from which pixels will be averaged to form the final color for each pixel. The operation approximates a Gaussian blur. A radius of `0.dp` means no blur. The higher the radius, the denser the blur. For blur behind, a radius of `10.dp` (\~20 px) creates a good depth-of-field effect. Avoid blur radii higher than `50.dp` (\~150 px), as this will significantly impact performance. Some devices might not support cross-window blur due to GPU limitations. It can also be disabled by the system at runtime (e.g. during battery saving mode). In such situations, no blur will be computed or drawn. Supported on Android 12 (`https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#S`) and above.

### clippingEnabled

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val clippingEnabled: Boolean
```

Whether to allow the popup window to extend beyond the bounds of the screen. By default the window is clipped to the screen boundaries. Setting this to false will allow windows to be accurately positioned. The default value is true.

### dismissOnBackPress

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val dismissOnBackPress: Boolean
```

Whether the popup can be dismissed by pressing the back or escape buttons on Android or the escape key on desktop. If true, pressing the back button will call onDismissRequest. Note that `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#focusable()` must be set to true in order to receive key events such as the back button - if the popup is not focusable then this property does nothing.

### dismissOnClickOutside

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val dismissOnClickOutside: Boolean
```

Whether the popup can be dismissed by clicking outside the popup's bounds. If true, clicking outside the popup will call onDismissRequest.

### excludeFromSystemGesture

android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val excludeFromSystemGesture: Boolean
```

A flag to check whether to set the systemGestureExclusionRects. The default is true.

### focusable

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val focusable: Boolean
```

Whether the popup is focusable. When true, the popup will receive IME events and key presses, such as when the back button is pressed.

### scrimAlpha

android Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
val scrimAlpha: Float
```

The opacity of the scrim (also known as dimming) applied behind the popup window. Ranging from 0.0f (no scrim) to 1.0f (completely opaque). By default, this value is `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html`, which means the popup retains the standard system popup behavior with no scrim applied behind the window.

Example usage:

### securePolicy

android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val securePolicy: SecureFlagPolicy
```

Policy for how `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SECURE` is set on the popup's window.

### usePlatformDefaultWidth

Cmn android Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val usePlatformDefaultWidth: Boolean
```

Whether the width of the popup's content should be limited to the platform default, which is smaller than the screen width.

### windowToken

android Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
val windowToken: IBinder?
```

An optional `https://developer.android.com/reference/android/os/IBinder.html` to be used as the window token for the popup window. In most cases, this can be left null, and the popup will use the token from the hosting Compose view (`https://developer.android.com/reference/android/view/View.html#getApplicationWindowToken()`). However, this parameter is essential for cross-process scenarios. For instance, if a Service running in a different process needs to display a popup anchored to a window in the main application process, the main application's window token must be provided here. The provided token must be a valid`https://developer.android.com/reference/android/os/IBinder.html` from an existing window and must have the necessary permissions to add sub-windows of the specified`https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#windowType()`. Providing an invalid, stale, or permission-denied token will typically result in an `https://developer.android.com/reference/android/view/WindowManager.BadTokenException.html` when the popup attempts to show.

### windowType

android Added in [1.11.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.11.0)

```
val windowType: Int
```

An optional `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#type` for the popup window. Defaults to `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#TYPE_APPLICATION_SUB_PANEL`. Overriding this allows you to change the layer or behavior of the popup. For example, setting it to `https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#TYPE_APPLICATION_OVERLAY` can be used to display a popup on top of all other applications (which requires the `https://developer.android.com/reference/android/Manifest.permission.html#SYSTEM_ALERT_WINDOW` permission). Note: If you are displaying a popup from a non-Activity context (such as an `https://developer.android.com/reference/android/app/Service.html`) but still want it to be anchored to an existing application window, you should leave this as the default sub-panel type and instead provide the `https://developer.android.com/reference/kotlin/androidx/compose/ui/window/PopupProperties#windowToken()` of the target application window.