Skip to content

Conversation

@m-sasha
Copy link

@m-sasha m-sasha commented Jan 20, 2026

singleWindowApplication content now receives SingleWindowApplicationScope, which is a subtype of both ApplicationScope and FrameWindowScope

Fixes Cannot exitApplication() in singleWindowApplication

Testing

Tested with

fun main() {
    singleWindowApplication(exitProcessOnExit = false) {
        Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
            Button(
                onClick = {
                    exitApplication()
                }
            ) {
                Text("Close App")
            }
        }
    }

    println("Application exited")
}

making sure "Application exited" is printed after pressing the "Close App" button.

Release Notes

Features - Desktop

  • singleWindowApplication content's receiver now subclasses ApplicationScope too, allowing to programmatically exit the app.

@m-sasha m-sasha requested a review from igordmn January 20, 2026 14:01
@MatkovIvan MatkovIvan changed the title singleWindowApplication content now receives ApplicationScope too. singleWindowApplication content now receives ApplicationScope too Jan 20, 2026
Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

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

Needs 2 approvals

@igordmn igordmn requested a review from MatkovIvan January 20, 2026 15:08
@Deprecated(
level = DeprecationLevel.HIDDEN,
message = "Replaced by override that takes a `SingleWindowApplicationScope`"
)
Copy link
Member

Choose a reason for hiding this comment

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

In general, we don't need to keep compatibility for experimental, but let's keep it for one version.

Please add YT tasks for:

  • Remove ExperimentalComposeUiApi/Deprecated override in 1.12
  • Stabilize ExperimentalComposeUiApi overrides

Copy link
Author

Choose a reason for hiding this comment

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

Is there a need to remove the deprecated version? It's marked as HIDDEN, but provides binary backwards compatibility, so I don't see any harm to keep it.

Copy link
Member

Choose a reason for hiding this comment

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

The experimental annotation is added to be able to remove/change it in the next version without deprecation/keeping it in the codebase forever. There is no reason to keep it

Copy link
Author

Choose a reason for hiding this comment

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

My question was about the removal of the non-experimental overload.

Copy link
Author

Choose a reason for hiding this comment

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

Although, actually it applies to the experimental one too.
The reason to keep it is to continue providing binary backwards compatibility. I don't see a reason to not do that.

Copy link
Member

@MatkovIvan MatkovIvan Jan 26, 2026

Choose a reason for hiding this comment

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

My question was about the removal of the non-experimental overload.

We should keep it compatibility/deprecated version for non-experimental variant

The reason to keep it is to continue providing binary backwards compatibility.

It's not an argument for experimental API

I don't see a reason to not do that.

To keep semantics of experimental, to keep our codebase clean.
Also, I don't really see the use case where it might be useful for anybody – the entry point isn't used in libraries anyway

@m-sasha m-sasha merged commit c48766b into jb-main Jan 22, 2026
21 checks passed
@m-sasha m-sasha deleted the m-sasha/add-singleWindowApplication-appScope branch January 22, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants