mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 21:35:59 +00:00
fix: Steam Input mouse clicks, scrolling and pointer moves reach games again
This commit is contained in:
1 parent
2bd279a0f3
commit
a66d7d74a4
2 files changed
+39
-2
No files matched your search
@@ -51,9 +51,16 @@ static void rt_send(void *dpy, uint32_t action) {
|
||||
}
|
||||
}
|
||||
|
||||
static void *rt_xtst(const char *name) {
|
||||
void *fn = dlsym(RTLD_NEXT, name);
|
||||
if (fn) return fn;
|
||||
void *lib = dlopen("libXtst.so.6", RTLD_LAZY | RTLD_NOLOAD);
|
||||
return lib ? dlsym(lib, name) : NULL;
|
||||
}
|
||||
|
||||
int XTestFakeMotionEvent(void *dpy, int screen, int x, int y, unsigned long delay) {
|
||||
static int (*real)(void *, int, int, int, unsigned long);
|
||||
if (!real) real = (int (*)(void *, int, int, int, unsigned long))dlsym(RTLD_NEXT, "XTestFakeMotionEvent");
|
||||
if (!real) real = (int (*)(void *, int, int, int, unsigned long))rt_xtst("XTestFakeMotionEvent");
|
||||
if (rt_enabled()) {
|
||||
pthread_mutex_lock(&rt_lock);
|
||||
rt_x = x;
|
||||
@@ -69,7 +76,7 @@ int XTestFakeMotionEvent(void *dpy, int screen, int x, int y, unsigned long dela
|
||||
|
||||
int XTestFakeButtonEvent(void *dpy, unsigned int button, int press, unsigned long delay) {
|
||||
static int (*real)(void *, unsigned int, int, unsigned long);
|
||||
if (!real) real = (int (*)(void *, unsigned int, int, unsigned long))dlsym(RTLD_NEXT, "XTestFakeButtonEvent");
|
||||
if (!real) real = (int (*)(void *, unsigned int, int, unsigned long))rt_xtst("XTestFakeButtonEvent");
|
||||
if (button == 1) {
|
||||
pthread_mutex_lock(&rt_lock);
|
||||
int handled = 0;
|
||||
|
||||
Reference in new issue
Block a user