mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 23:07:18 +00:00
[client] set the compositor bypass hint
This commit is contained in:
parent
8adf7cbacd
commit
e2c1f1cd77
@ -18,7 +18,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
#include <SDL_ttf.h>
|
#include <SDL2/SDL_syswm.h>
|
||||||
|
#include <SDL2/SDL_ttf.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -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)
|
if (!state.window)
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("failed to create window");
|
DEBUG_ERROR("failed to create window");
|
||||||
|
Loading…
Reference in New Issue
Block a user