From 5508c635cb11b61df9bfc3d9e5e603492100b067 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Thu, 27 Jan 2022 23:32:37 +0100 Subject: [PATCH] Enable mouse focus clickthrough in OTG mode A single click on the window must both give focus and capture the mouse. PR #2974 --- app/src/usb/scrcpy_otg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/usb/scrcpy_otg.c b/app/src/usb/scrcpy_otg.c index f2e5d549..e27a3605 100644 --- a/app/src/usb/scrcpy_otg.c +++ b/app/src/usb/scrcpy_otg.c @@ -62,6 +62,10 @@ scrcpy_otg(struct scrcpy_options *options) { atexit(SDL_Quit); + if (!SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1")) { + LOGW("Could not enable mouse focus clickthrough"); + } + bool ret = false; struct sc_hid_keyboard *keyboard = NULL;