Skip to content

Allow specifying AWT AccessibleRole directly - #2577

Merged
Alexander Maryanovsky (m-sasha) merged 4 commits into
jb-mainfrom
m-sasha/support-awt-role
Nov 24, 2025
Merged

Allow specifying AWT AccessibleRole directly#2577
Alexander Maryanovsky (m-sasha) merged 4 commits into
jb-mainfrom
m-sasha/support-awt-role

Conversation

@m-sasha

@m-sasha Alexander Maryanovsky (m-sasha) commented Nov 18, 2025

Copy link
Copy Markdown

To allow specifying AccessibleRoles with no corresponding Compose role, add SemanticsPropertyReceiver.awtRole.

Fixes https://youtrack.jetbrains.com/issue/CMP-9296/Support-specifying-AWT-AccessibleRole-in-semantics

Testing

Added a unit test, and tested manually with

@OptIn(ExperimentalComposeUiApi::class)
fun main() = singleWindowApplication {
    Box(
        modifier = Modifier
            .padding(16.dp)
            .clip(RoundedCornerShape(10.dp))
            .background(Color.Blue)
            .semantics(mergeDescendants = true) {
                awtRole = AccessibleRole.PUSH_BUTTON
            }
            .clickable {
                println("Clicked!")
            }
            .padding(horizontal = 16.dp, vertical = 8.dp),
        contentAlignment = Alignment.Center
    ) {
        Text("Click me", color = Color.White)
    }
}

This should be tested by QA

Release Notes

Features - Desktop

  • Allow specifying AWT AccessibleRole directly via SemanticsPropertyReceiver.awtRole.
@MatkovIvan Ivan Matkov (MatkovIvan) changed the title Allow specifying AWT AccessibleRole directly. Nov 18, 2025

@igordmn Igor Demin (igordmn) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, but we need to wait for 1.10 branch.

Also needs 2 approvals.

@m-sasha
Alexander Maryanovsky (m-sasha) merged commit d7a4c15 into jb-main Nov 24, 2025
16 checks passed
@m-sasha
Alexander Maryanovsky (m-sasha) deleted the m-sasha/support-awt-role branch November 24, 2025 12:11
Zahari Zahariev (harryzz) pushed a commit to harryzz/compose-multiplatform-core that referenced this pull request Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants