Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Use info about target windows of mouse events
Browse files Browse the repository at this point in the history
  • Loading branch information
SerVB committed Jul 23, 2020
1 parent bd86204 commit bf9ef7d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class ProjectorServer private constructor(

PMouseInfoPeer.lastMouseCoords.setLocation(shiftedMessage.x, shiftedMessage.y)

val window = PWindow.findWindowAt(shiftedMessage.x, shiftedMessage.y)?.target ?: return@invokeLater
val window = PWindow.getWindow(message.windowId)?.target ?: return@invokeLater

fun isEnoughDeltaForScrolling(previousTouchState: TouchState.Scrolling, newX: Int, newY: Int): Boolean {
// reduce number of scroll events to make deltas bigger.
Expand Down Expand Up @@ -301,7 +301,7 @@ class ProjectorServer private constructor(
val shiftedMessage = message.shift(PGraphicsDevice.clientShift)
PMouseInfoPeer.lastMouseCoords.setLocation(shiftedMessage.x, shiftedMessage.y)

val window = PWindow.findWindowAt(shiftedMessage.x, shiftedMessage.y)?.target ?: return@invokeLater
val window = PWindow.getWindow(message.windowId)?.target ?: return@invokeLater

val mouseWheelEvent = createMouseWheelEvent(window, shiftedMessage, clientSettings.connectionMillis)
laterInvokator(mouseWheelEvent)
Expand Down

0 comments on commit bf9ef7d

Please sign in to comment.