From 86b8286217b0909bf409e68ac1885ee59cc4cefc Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 8 Jul 2024 16:33:10 +0200 Subject: [PATCH] Remove unused virtual mouse PR #5076 --- app/src/control_msg.c | 2 -- app/src/control_msg.h | 3 +-- server/src/main/java/com/genymobile/scrcpy/Controller.java | 5 ++--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/control_msg.c b/app/src/control_msg.c index 5a80004032..9b0fab6773 100644 --- a/app/src/control_msg.c +++ b/app/src/control_msg.c @@ -68,8 +68,6 @@ get_well_known_pointer_id_name(uint64_t pointer_id) { return "mouse"; case SC_POINTER_ID_GENERIC_FINGER: return "finger"; - case SC_POINTER_ID_VIRTUAL_MOUSE: - return "vmouse"; case SC_POINTER_ID_VIRTUAL_FINGER: return "vfinger"; default: diff --git a/app/src/control_msg.h b/app/src/control_msg.h index 2ec7b5be25..80714096b7 100644 --- a/app/src/control_msg.h +++ b/app/src/control_msg.h @@ -22,8 +22,7 @@ #define SC_POINTER_ID_GENERIC_FINGER UINT64_C(-2) // Used for injecting an additional virtual pointer for pinch-to-zoom -#define SC_POINTER_ID_VIRTUAL_MOUSE UINT64_C(-3) -#define SC_POINTER_ID_VIRTUAL_FINGER UINT64_C(-4) +#define SC_POINTER_ID_VIRTUAL_FINGER UINT64_C(-3) enum sc_control_msg_type { SC_CONTROL_MSG_TYPE_INJECT_KEYCODE, diff --git a/server/src/main/java/com/genymobile/scrcpy/Controller.java b/server/src/main/java/com/genymobile/scrcpy/Controller.java index 87faf8ba29..b7d2f93e8b 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Controller.java +++ b/server/src/main/java/com/genymobile/scrcpy/Controller.java @@ -22,7 +22,6 @@ public class Controller implements AsyncProcessor { // control_msg.h values of the pointerId field in inject_touch_event message private static final int POINTER_ID_MOUSE = -1; - private static final int POINTER_ID_VIRTUAL_MOUSE = -3; private static final ScheduledExecutorService EXECUTOR = Executors.newSingleThreadScheduledExecutor(); @@ -273,8 +272,8 @@ private boolean injectTouch(int action, long pointerId, Position position, float pointer.setPressure(pressure); int source; - if (pointerId == POINTER_ID_MOUSE || pointerId == POINTER_ID_VIRTUAL_MOUSE) { - // real mouse event (forced by the client when --forward-on-click) + if (pointerId == POINTER_ID_MOUSE) { + // real mouse event pointerProperties[pointerIndex].toolType = MotionEvent.TOOL_TYPE_MOUSE; source = InputDevice.SOURCE_MOUSE; pointer.setUp(buttons == 0);