From 068253a3a299a60d78c7c1b0e760f4bbe3b75bc1 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sat, 4 May 2019 17:48:20 +0200 Subject: [PATCH 1/2] Fix mouse focus clickthrough Mouse focus clickthrough didn't work due to compat.h header not being included in scrcpy.c. Signed-off-by: Romain Vimont --- app/src/scrcpy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index 61b3f8d9..ebcd81ba 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -9,6 +9,7 @@ #include "command.h" #include "common.h" +#include "compat.h" #include "controller.h" #include "decoder.h" #include "device.h" From b941854c7375a0c9a9f3ef957ccbf659e645490c Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sat, 4 May 2019 17:48:20 +0200 Subject: [PATCH 2/2] Disable X11 compositor bypass Compositor bypass is meant for fullscreen games consuming lots of GPU resources. For a light app that will usually be windowed, this only causes unnecessary compositor suspends, especially visible (and annoying) with complying window manager like KWin. Signed-off-by: Romain Vimont --- app/src/compat.h | 5 +++++ app/src/scrcpy.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/app/src/compat.h b/app/src/compat.h index fd68d61a..de667bbf 100644 --- a/app/src/compat.h +++ b/app/src/compat.h @@ -43,4 +43,9 @@ # define SCRCPY_SDL_HAS_WINDOW_ALWAYS_ON_TOP #endif +#if SDL_VERSION_ATLEAST(2, 0, 8) +// +# define SCRCPY_SDL_HAS_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR +#endif + #endif diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index ebcd81ba..b777b770 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -69,6 +69,13 @@ sdl_init_and_configure(bool display) { } #endif +#ifdef SCRCPY_SDL_HAS_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR + // Disable compositor bypassing on X11 + if (!SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0")) { + LOGW("Could not disable X11 compositor bypass"); + } +#endif + // Do not disable the screensaver when scrcpy is running SDL_EnableScreenSaver();