mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[client] added xlib-shim to disable calls to XSync
The compiled xlib-shim.so can be used to intercept and prevent SDL from calling XSync, which causes latency issues on some video hardware. To use specify the full path to the file in the LD_PRELOAD environment variable, like so: LD_PRELOAD=/full/path/xlib-shim.so ./looking-glass
This commit is contained in:
parent
c61d97b0ac
commit
d591e2fd36
@ -26,7 +26,10 @@ OBJS = main.o \
|
||||
|
||||
BUILD_OBJS = $(foreach obj,$(OBJS),$(BUILD)/$(obj))
|
||||
|
||||
all: $(BIN)/$(BINARY)
|
||||
all: $(BIN)/$(BINARY) $(BIN)/xlib-shim.so
|
||||
|
||||
$(BIN)/xlib-shim.so:
|
||||
gcc -fPIC $(CFLAGS) -shared -o $@ xlib-shim.c
|
||||
|
||||
$(BUILD)/%.o: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
|
15
client/xlib-shim.c
Normal file
15
client/xlib-shim.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <stdbool.h>
|
||||
#include "debug.h"
|
||||
|
||||
int XSync(Display * display, Bool discard)
|
||||
{
|
||||
static bool doneInfo = false;
|
||||
if (!doneInfo)
|
||||
{
|
||||
DEBUG_INFO("XSync Override Enabled");
|
||||
doneInfo = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user