Skip to content

Commit 9c19868

Browse files
committed
Revert "Make semanticsOwners snapshot state"
This reverts commit 71158c1.
1 parent 057f4f3 commit 9c19868

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposePanel.desktop.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ class ComposePanel @ExperimentalComposeUiApi constructor(
217217
/**
218218
* Returns the [SemanticsOwner]s corresponding to the roots of the semantics trees in this
219219
* [ComposePanel].
220-
*
221-
* This is backed by snapshot state, so reading this property in a restartable function (e.g., a
222-
* composable function) will cause the function to restart when set of semantics owners changes.
223220
*/
224221
@ExperimentalComposeUiApi
225222
val semanticsOwners: Collection<SemanticsOwner>

compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/awt/ComposeWindow.desktop.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ class ComposeWindow @ExperimentalComposeUiApi constructor(
8585
/**
8686
* Returns the [SemanticsOwner]s corresponding to the roots of the semantics trees in this
8787
* [ComposeWindow].
88-
*
89-
* This is backed by snapshot state, so reading this property in a restartable function (e.g., a
90-
* composable function) will cause the function to restart when set of semantics owners changes.
9188
*/
9289
@ExperimentalComposeUiApi
9390
val semanticsOwners: Collection<SemanticsOwner>

compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/scene/ComposeSceneMediator.desktop.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package androidx.compose.ui.scene
1818

1919
import androidx.compose.runtime.Composable
2020
import androidx.compose.runtime.CompositionLocalContext
21-
import androidx.compose.runtime.mutableStateSetOf
2221
import androidx.compose.ui.ComposeFeatureFlags
2322
import androidx.compose.ui.awt.AwtEventListener
2423
import androidx.compose.ui.awt.AwtEventListeners
@@ -669,7 +668,8 @@ internal class ComposeSceneMediator(
669668
private val _accessibilityControllers = linkedMapOf<SemanticsOwner, AccessibilityController>()
670669
val accessibilityControllers get() = _accessibilityControllers.values.reversed()
671670

672-
val semanticsOwners: Collection<SemanticsOwner> get() = _accessibilityControllers.keys
671+
val semanticsOwners: Collection<SemanticsOwner>
672+
get() = _accessibilityControllers.keys
673673

674674
override fun onSemanticsOwnerAppended(semanticsOwner: SemanticsOwner) {
675675
check(semanticsOwner !in _accessibilityControllers)

compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/ImageComposeScene.skiko.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ package androidx.compose.ui
2020

2121
import androidx.compose.runtime.Composable
2222
import androidx.compose.runtime.LaunchedEffect
23-
import androidx.compose.runtime.mutableStateSetOf
2423
import androidx.compose.runtime.rememberCoroutineScope
2524
import androidx.compose.runtime.withFrameNanos
2625
import androidx.compose.ui.geometry.Offset
@@ -158,7 +157,7 @@ class ImageComposeScene @ExperimentalComposeUiApi constructor(
158157
private val _platformContext = object : PlatformContext by PlatformContext.Empty,
159158
PlatformContext.SemanticsOwnerListener {
160159

161-
val semanticsOwners = mutableStateSetOf<SemanticsOwner>()
160+
val semanticsOwners = linkedSetOf<SemanticsOwner>()
162161

163162
override fun onSemanticsOwnerAppended(semanticsOwner: SemanticsOwner) {
164163
semanticsOwners.add(semanticsOwner)
@@ -198,9 +197,6 @@ class ImageComposeScene @ExperimentalComposeUiApi constructor(
198197
/**
199198
* Returns the [SemanticsOwner]s corresponding to the roots of the semantics trees in this
200199
* [ImageComposeScene].
201-
*
202-
* This is backed by snapshot state, so reading this property in a restartable function (e.g., a
203-
* composable function) will cause the function to restart when set of semantics owners changes.
204200
*/
205201
@ExperimentalComposeUiApi
206202
val semanticsOwners: Collection<SemanticsOwner>

0 commit comments

Comments
 (0)