Skip to content

Comments

Add modalityType parameter to DialogWindow#2300

Merged
m-sasha merged 3 commits intojb-mainfrom
m-sasha/add-modality-parameter-to-dialogwindow
Aug 11, 2025
Merged

Add modalityType parameter to DialogWindow#2300
m-sasha merged 3 commits intojb-mainfrom
m-sasha/add-modality-parameter-to-dialogwindow

Conversation

@m-sasha
Copy link

@m-sasha m-sasha commented Aug 8, 2025

Add modalityType parameter to DialogWindow

Testing

Tested manually with

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.window.DialogModalityType
import androidx.compose.ui.window.DialogWindow
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import java.awt.Dialog.ModalityType

@OptIn(ExperimentalComposeUiApi::class)
fun main() {
    application {
        val windowState = rememberWindowState()
        Window(
            onCloseRequest = ::exitApplication,
            state = windowState,
        ) {
            Box(
                modifier = Modifier
                    .fillMaxSize()
                    .background(Color.Black)
            )

            DialogWindow(
                onCloseRequest = {},
                modalityType = DialogModalityType.Modeless
            ) {
                Box(
                    modifier = Modifier
                        .fillMaxSize()
                        .background(Color.Black)
                )
            }
        }
    }
}

This could be tested by QA

Release Notes

Features - Desktop

  • Added modalityType parameter to DialogWindow().

@m-sasha m-sasha requested review from MatkovIvan and igordmn August 8, 2025 09:23
@m-sasha m-sasha force-pushed the m-sasha/add-modality-parameter-to-dialogwindow branch from 6fd03ea to 58e33cd Compare August 8, 2025 09:26
title: String = "Untitled",
icon: Painter? = null,
decoration: WindowDecoration,
decoration: WindowDecoration = WindowDecoration.SystemDefault,
Copy link
Collaborator

@igordmn igordmn Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have it experimental for some time. We need to start stabilize functions which we added earlier, and schedule stabilizing modalityType as well.

Please, create issues for stabilizing decoration/modalityType with appropriate target versions (this doc says we usually should stabilize in the +2 version)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added new versions with discussion with Kropp

Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please re-gen once again API dump

@m-sasha m-sasha merged commit 8faa621 into jb-main Aug 11, 2025
10 checks passed
@m-sasha m-sasha deleted the m-sasha/add-modality-parameter-to-dialogwindow branch August 11, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants