From 2c25fd7a8082307da19645a690c31403903fbb1e Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Tue, 29 Oct 2024 18:59:29 +0100 Subject: [PATCH] Disable mouse by default if no video playback If video playback is disabled, then SDK mouse (which uses absolute positions) could not be used, so the default mouse mode was automatically switched to UHID. But UHID does not work on all devices, so it could make the whole scrcpy session fail. Instead, disable the mouse by default. It is still possible to pass -M or --mouse=uhid to enable it explicitly. Fixes #5410 --- app/src/cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/cli.c b/app/src/cli.c index d4caaa89..2437d5fc 100644 --- a/app/src/cli.c +++ b/app/src/cli.c @@ -2841,8 +2841,8 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[], if (otg) { opts->mouse_input_mode = SC_MOUSE_INPUT_MODE_AOA; } else if (!opts->video_playback) { - LOGI("No video mirroring, mouse mode switched to UHID"); - opts->mouse_input_mode = SC_MOUSE_INPUT_MODE_UHID; + LOGI("No video mirroring, SDK mouse disabled"); + opts->mouse_input_mode = SC_MOUSE_INPUT_MODE_DISABLED; } else { opts->mouse_input_mode = SC_MOUSE_INPUT_MODE_SDK; }