Skip to content

Commit

Permalink
Merge pull request #125 from JetBrains/feature/remove_async_events
Browse files Browse the repository at this point in the history
Remove async events
  • Loading branch information
igordmn authored Nov 25, 2021
2 parents b22a324 + f8638e9 commit c9896b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 179 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ import androidx.compose.ui.input.key.KeyEvent as ComposeKeyEvent
internal class ComposeLayer {
private var isDisposed = false

// TODO(demin): probably we need to get rid of asynchronous events. it was added because of
// slow lazy scroll. But events become unpredictable, and we can't consume them.
// Alternative solution to a slow scroll - merge multiple scroll events into a single one.
private val events = AWTDebounceEventQueue()

private val _component = ComponentImpl()
val component: SkiaLayer get() = _component

Expand Down Expand Up @@ -247,7 +242,7 @@ internal class ComposeLayer {
}
}

override fun inputMethodTextChanged(event: InputMethodEvent) = events.post {
override fun inputMethodTextChanged(event: InputMethodEvent) {
catchExceptions {
scene.onInputMethodEvent(event)
}
Expand Down Expand Up @@ -280,19 +275,15 @@ internal class ComposeLayer {

private fun onMouseEvent(event: MouseEvent) {
lastMouseEvent = event
events.post {
catchExceptions {
scene.onMouseEvent(density, event)
}
catchExceptions {
scene.onMouseEvent(density, event)
}
}

private fun onMouseWheelEvent(event: MouseWheelEvent) {
lastMouseEvent = event
events.post {
catchExceptions {
scene.onMouseWheelEvent(density, event)
}
catchExceptions {
scene.onMouseWheelEvent(density, event)
}
}

Expand All @@ -307,7 +298,6 @@ internal class ComposeLayer {
fun dispose() {
check(!isDisposed)
scene.close()
events.cancel()
_component.dispose()
_initContent = null
isDisposed = true
Expand Down

This file was deleted.

0 comments on commit c9896b9

Please sign in to comment.