Skip to content

Commit

Permalink
Merge pull request #522 from dos1/compositor
Browse files Browse the repository at this point in the history
Disable X11 compositor bypass
  • Loading branch information
rom1v committed May 5, 2019
2 parents ffa8c66 + b941854 commit 39b5893
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/src/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@
# define SCRCPY_SDL_HAS_WINDOW_ALWAYS_ON_TOP
#endif

#if SDL_VERSION_ATLEAST(2, 0, 8)
// <https://hg.libsdl.org/SDL/rev/dfde5d3f9781>
# define SCRCPY_SDL_HAS_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR
#endif

#endif
8 changes: 8 additions & 0 deletions app/src/scrcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "command.h"
#include "common.h"
#include "compat.h"
#include "controller.h"
#include "decoder.h"
#include "device.h"
Expand Down Expand Up @@ -68,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();

Expand Down

0 comments on commit 39b5893

Please sign in to comment.