Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.runtime.State
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshots.Snapshot
import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.draganddrop.UIKitDragAndDropManager
import androidx.compose.ui.geometry.Offset
Expand Down Expand Up @@ -481,6 +482,11 @@ internal class ComposeSceneMediator(
nativeEvent = event,
keyboardModifiers = PointerKeyboardModifiers(event.modifierFlagsOrZero)
)

// Fixes the issue when the `sendPointerEvent` does not trigger `setNeedsRedraw` synchronously,
// which lead to frame drops during input.
// TODO: Remove after CMP-10411
Snapshot.sendApplyNotifications()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we write a test for it to avoid regressions? I know it's not reproducible on Simulators, but maybe we can control event sequence perversely enough in the test environment

}

private fun onHoverEvent(
Expand Down Expand Up @@ -508,6 +514,11 @@ internal class ComposeSceneMediator(
nativeEvent = event,
keyboardModifiers = PointerKeyboardModifiers(event.modifierFlagsOrZero)
)

// Fixes the issue when the `sendPointerEvent` does not trigger `setNeedsRedraw` synchronously,
// which lead to frame drops during input.
// TODO: Remove after CMP-10411
Snapshot.sendApplyNotifications()
}

private fun onCancelScroll() {
Expand Down Expand Up @@ -582,6 +593,11 @@ internal class ComposeSceneMediator(
if (eventKind != TouchesEventKind.MOVED) {
previousTouchEventKind = eventKind
}

// Fixes the issue when the `sendPointerEvent` does not trigger `setNeedsRedraw` synchronously,
// which lead to frame drops during input.
// TODO: Remove after CMP-10411
Snapshot.sendApplyNotifications()
}
}
private var previousButtonMask: Long = 0L
Expand Down
Loading