diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a03657..cac1064 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - In Controlify's mixed input mode, `Controllers.isActive` follows whichever device the player used last - Added `InputKind` and `ComposeOptions.onInputKind(owner, kind)`, which now reports controller navigation too, and `KeyEvent.isFromController` - `org.polyfrost.compose.minecraft.compat.controlify.ControllerActions`, `ControllerAction` and `ControllerButton` are deprecated in favour of the new classes in `org.polyfrost.compose.host.controller` +- Fixed screens not redrawing when their content changed in the background, so they stayed blank or out of date until you moved the mouse ## [3.0.10] diff --git a/src/main/kotlin/org/polyfrost/compose/minecraft/screen/SceneFrames.kt b/src/main/kotlin/org/polyfrost/compose/minecraft/screen/SceneFrames.kt index 23c0aea..b58fe54 100644 --- a/src/main/kotlin/org/polyfrost/compose/minecraft/screen/SceneFrames.kt +++ b/src/main/kotlin/org/polyfrost/compose/minecraft/screen/SceneFrames.kt @@ -2,6 +2,7 @@ package org.polyfrost.compose.minecraft.screen +import androidx.compose.runtime.snapshots.Snapshot import androidx.compose.ui.InternalComposeUiApi import androidx.compose.ui.graphics.Canvas import androidx.compose.ui.platform.FrameRecomposer @@ -16,8 +17,10 @@ internal class SceneFrames(private val schedule: () -> Unit) { val onInvalidation: () -> Unit = { if (!inFrame) schedule() } - fun hasWork(recomposer: FrameRecomposer, scene: ComposeScene): Boolean = - recomposer.hasPendingWork() || scene.hasInvalidations() + fun hasWork(recomposer: FrameRecomposer, scene: ComposeScene): Boolean { + Snapshot.sendApplyNotifications() + return recomposer.hasPendingWork() || scene.hasInvalidations() + } fun advance(recomposer: FrameRecomposer, scene: ComposeScene, nanos: Long, profile: ProfileHost?) { inFrame = true