summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2022-07-29 12:05:32 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2023-04-28 00:56:38 +0000
commit2dbdc2adf8cc7983f153b6ca90c3a87b0997ddb5 (patch)
tree5c8c042d9a39f70c5bd7295746e7765f76795f0c
parent889cfceebd77c58734477e3083d1577b17884046 (diff)
Add support for the XWAYLAND extension
Where this extension is present, we can be sure the X server is Xwayland. Since it'll take a while for servers to propagate, leave the existing check in place as fallback. See https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/54 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/xinput.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/xinput.c b/src/xinput.c
index 6a941f3..c23e5ad 100644
--- a/src/xinput.c
+++ b/src/xinput.c
@@ -388,6 +388,7 @@ main(int argc, char * argv[])
entry *driver = drivers;
char *func;
int event, error;
+ int xwl_op, xwl_ev, xwl_err;
if (argc > 1) {
func = argv[1];
@@ -422,7 +423,7 @@ main(int argc, char * argv[])
goto out;
}
- if (is_xwayland(display))
+ if (XQueryExtension(display, "XWAYLAND", &xwl_op, &xwl_ev, &xwl_err) || is_xwayland(display))
fprintf(stderr, "WARNING: running xinput against an Xwayland server. See the xinput man page for details.\n");
while(driver->func_name) {