diff --git a/client/main.c b/client/main.c index a2abfcd2..25acbd87 100644 --- a/client/main.c +++ b/client/main.c @@ -18,7 +18,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include #include -#include +#include +#include #include #include #include @@ -625,6 +626,32 @@ int run() ) ); + // set the compositor hint to bypass for low latency + SDL_SysWMinfo wminfo; + SDL_VERSION(&wminfo.version); + if (SDL_GetWindowWMInfo(state.window, &wminfo)) + { + if (wminfo.subsystem == SDL_SYSWM_X11) + { + Atom NETWM_BYPASS_COMPOSITOR = XInternAtom( + wminfo.info.x11.display, + "NETWM_BYPASS_COMPOSITOR", + False); + + unsigned long value = 1; + XChangeProperty( + wminfo.info.x11.display, + wminfo.info.x11.window, + NETWM_BYPASS_COMPOSITOR, + XA_CARDINAL, + 32, + PropModeReplace, + (unsigned char *)&value, + 1 + ); + } + } + if (!state.window) { DEBUG_ERROR("failed to create window");