Skip to content
New issue

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

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

Already on GitHub? # to your account

Pass externalAccessibleFactory to SkiaSwingLayer. #1688

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.compose.ui.scene.ComposeSceneMediator
import java.awt.Dimension
import java.awt.Graphics
import javax.accessibility.Accessible
import javax.accessibility.AccessibleContext
import org.jetbrains.skiko.ExperimentalSkikoApi
import org.jetbrains.skiko.SkiaLayerAnalytics
import org.jetbrains.skiko.SkikoRenderDelegate
Expand All @@ -46,7 +45,12 @@ internal class SwingSkiaLayerComponent(
override val contentComponent: SkiaSwingLayer =
object : SkiaSwingLayer(
renderDelegate = renderDelegate,
analytics = skiaLayerAnalytics
analytics = skiaLayerAnalytics,
externalAccessibleFactory = {
// It depends on initialization order, so explicitly
// apply `checkNotNull` for "non-null" field.
checkNotNull(mediator.accessible)
}
) {
override fun paint(g: Graphics) {
mediator.onChangeDensity()
Expand All @@ -65,10 +69,6 @@ internal class SwingSkiaLayerComponent(
} else {
mediator.preferredSize
}

override fun getAccessibleContext(): AccessibleContext? {
return mediator.accessible.accessibleContext
}
}

override val renderApi by contentComponent::renderApi
Expand Down
Loading