Skip to content

Commit

Permalink
Pass externalAccessibleFactory to SkiaSwingLayer. (#1688)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-sasha authored Nov 11, 2024
1 parent 4c95b62 commit 5cbbd01
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 5cbbd01

Please sign in to comment.