Skip to content

Commit

Permalink
Remove usage of MultiLayerComposeScene.compositionLocalContext
Browse files Browse the repository at this point in the history
  • Loading branch information
MatkovIvan committed Apr 3, 2024
1 parent 6315660 commit 1924208
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,13 @@ private class MultiLayerComposeSceneImpl(
* This scenario is important when user code relies on hover events to show tooltips.
*/
override var boundsInWindow: IntRect by mutableStateOf(IntRect.Zero)

@Deprecated(
message = "Should not be used in this implementation",
level = DeprecationLevel.ERROR
)
override var compositionLocalContext: CompositionLocalContext? = null

override var scrimColor: Color? by mutableStateOf(null)
override var focusable: Boolean = focusable
set(value) {
Expand Down Expand Up @@ -581,7 +587,14 @@ private class MultiLayerComposeSceneImpl(
composition?.dispose()
composition = owner.setContent(
parent = this@AttachedComposeSceneLayer.compositionContext,
{ this@AttachedComposeSceneLayer.compositionLocalContext }
{
/*
* Do not use `compositionLocalContext` here - composition locals already
* available from `compositionContext` and explicitly overriding it might cause
* issues. See https://github.com/JetBrains/compose-multiplatform/issues/4558
*/
null
}
) {
owner.setRootModifier(background then keyInput)
content()
Expand Down

0 comments on commit 1924208

Please sign in to comment.