Skip to content

Commit

Permalink
Fix delayed-click implementation
Browse files Browse the repository at this point in the history
- Insert delay only for left-click
- Ignore thread interruption during sleep
  • Loading branch information
gujjwal00 committed Feb 7, 2023
1 parent 3e0c2e9 commit bb81bec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/gaurav/avnc/ui/vnc/Dispatcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class Dispatcher(private val activity: VncActivity) {
fun doClick(button: PointerButton, p: PointF) {
doButtonDown(button, p)
// Some (obscure) apps seems to ignore click event if button-up is received too early
if (profile.cfButtonUpDelay)
if (button == PointerButton.Left && profile.cfButtonUpDelay)
messenger.insertButtonUpDelay()
doButtonUp(button, p)
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/gaurav/avnc/vnc/Messenger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Messenger(private val client: VncClient) {
}

fun insertButtonUpDelay() {
execute { Thread.sleep(200) }
execute { runCatching { Thread.sleep(200) } }
}

/**************************************************************************
Expand Down

0 comments on commit bb81bec

Please sign in to comment.