Commit d0a77e79 authored by Peter Hutterer's avatar Peter Hutterer

Warn if you're running against an XWayland server

Because there's a 99% chance you don't want this.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent c7ca2b99
......@@ -178,6 +178,24 @@ by the new value(s) of the property. For example:
.IP
\fBxinput set-prop "my device" "my prop" 1 2 3\fB
.SH "XWAYLAND"
Xwayland is an X server that uses a Wayland Compositor as backend.
Xwayland acts as translation layer between the X protocol and the Wayland
protocol but does not have direct access to the hardware. The X Input
Extension devices created by Xwayland ("xwayland-pointer",
"xwayland-keyboard", etc.) map to the Wayland protocol devices,
not to physical devices.
.PP
These X Input Extension devices are only visible to other X clients
connected to the same Xwayland process. Changing properties on Xwayland
devices only affects the behavior of those clients. For example, disabling
an Xwayland device with xinput does not disable the device in Wayland-native
applications. Other changes may not have any effect at all.
.PP
In most instances, using xinput with an Xwayland device is indicative of a
bug in a shell script and xinput will print a warning. Use the Wayland
Compositor's native device configuration methods instead.
.SH "SEE ALSO"
X(__miscmansuffix__), xset(__appmansuffix__), xrandr(__appmansuffix__)
.SH COPYRIGHT
......
......@@ -361,6 +361,26 @@ usage(void)
}
}
static Bool
is_xwayland(Display *dpy)
{
XDeviceInfo *devices;
int n;
Bool is_xwayland = False;
devices = XListInputDevices(dpy, &n);
while (n-- > 0) {
if (strncmp(devices[n].name, "xwayland-", 9) == 0) {
is_xwayland = True;
break;
}
}
XFreeDeviceList(devices);
return is_xwayland;
}
int
main(int argc, char * argv[])
{
......@@ -402,6 +422,9 @@ main(int argc, char * argv[])
goto out;
}
if (is_xwayland(display))
fprintf(stderr, "WARNING: running xinput against an Xwayland server. See the xinput man page for details.\n");
while(driver->func_name) {
if (strcmp(driver->func_name, func) == 0) {
int r = (*driver->func)(display, argc-2, argv+2,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment