Fix delayed-click implementation

- Insert delay only for left-click
- Ignore thread interruption during sleep
This commit is contained in:
Gaurav Ujjwal 2023-02-07 15:42:37 +05:30
parent 3e0c2e9808
commit bb81bec87b
2 changed files with 2 additions and 2 deletions

View file

@ -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)
}

View file

@ -81,7 +81,7 @@ class Messenger(private val client: VncClient) {
}
fun insertButtonUpDelay() {
execute { Thread.sleep(200) }
execute { runCatching { Thread.sleep(200) } }
}
/**************************************************************************