Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down