Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass externalAccessibleFactory to SkiaSwingLayer. #1688

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

m-sasha
Copy link
Member

@m-sasha m-sasha commented Nov 10, 2024

Pass ComposeSceneAccessible correctly to SkiaSwingLayer (like we do to SkiaLayer) so that NativeAccessibleFocusHelper can do its trick.

Fixes https://youtrack.jetbrains.com/issue/CMP-7059/Accessible-focus-traversal-doesnt-work-with-compose.swing.render.on.graphicstrue

Testing

Tested manually on

import androidx.compose.material.*
import androidx.compose.ui.awt.ComposePanel
import java.awt.GridLayout
import javax.swing.JButton
import javax.swing.JFrame
import javax.swing.JPanel
import javax.swing.SwingUtilities

fun main() {
    System.setProperty("compose.swing.render.on.graphics", "true")

    SwingUtilities.invokeLater {
        val frame = JFrame()
        frame.setSize(800, 200)
        frame.defaultCloseOperation = JFrame.EXIT_ON_CLOSE

        val panel = JPanel(GridLayout(1, 4))
        panel.add(JButton("Swing Button"))
        panel.add(ComposePanel().apply {
            setContent {
                Button(onClick = {}) { Text("Compose Button")}
            }
        })
        panel.add(JButton("Swing Button"))
        panel.add(ComposePanel().apply {
            setContent {
                Button(onClick = {}) { Text("Compose Button")}
            }
        })

        frame.contentPane.add(panel)

        frame.isVisible = true
    }
}

Release Notes

Fixes - Desktop

  • Fix accessibility focus when using compose.swing.render.on.graphics=true

@m-sasha m-sasha requested a review from igordmn November 10, 2024 16:16
@m-sasha m-sasha merged commit 5cbbd01 into jb-main Nov 11, 2024
6 of 7 checks passed
@m-sasha m-sasha deleted the m-sasha/fix-skiaswinglayer-a11y-focus branch November 11, 2024 17:07
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.

2 participants