Skip to content

Commit ef9f668

Browse files
authored
Call renderImmediately() without read observation in SwingWindow.update (JetBrains#2904)
1 parent db17864 commit ef9f668

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import androidx.compose.runtime.getValue
2323
import androidx.compose.runtime.remember
2424
import androidx.compose.runtime.rememberCoroutineScope
2525
import androidx.compose.runtime.rememberUpdatedState
26+
import androidx.compose.runtime.snapshots.Snapshot
2627
import androidx.compose.ui.ExperimentalComposeUiApi
2728
import androidx.compose.ui.graphics.painter.Painter
2829
import androidx.compose.ui.input.key.KeyEvent
@@ -138,7 +139,9 @@ fun SwingWindow(
138139
// - Make the window displayable
139140
// - Size the window and the ComposeLayer correctly, so that we can draw it here
140141
if (!wasDisplayable && it.isDisplayable) {
141-
it.renderImmediately()
142+
Snapshot.withoutReadObservation {
143+
it.renderImmediately()
144+
}
142145
}
143146
},
144147
)

0 commit comments

Comments
 (0)