You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detect if the X server is XWayland and report an error. (#342)
* Detect if the X server is XWayland and report an error.
Also: Detect if $DISPLAY env is not set and report a more informative
error message.
For the purposes of libxdo/xdotool, XWayland does not work, so it's best
to notify the user accordingly if detected.
This adds a dependency on XInput `libxi` because the only[1] way I have
found to detect XWayland is through this extension
[1] There is another detection method which uses
XFree86-VidModeExtension, but I don't know how common that extension is
compared to XInput2.
Fixes#341.
Related to #337.
* xdo_version.h update when VERSION updates
* Fix typo in version.sh which leaves an extra plus '+' character in the date
* Run help or version commands without trying to connect to the X11 display
* Free when detecting
// This library and xdotool do not work correctly on Wayland/XWayland.
120
+
// Try to detect XWayland and warn the user about problems.
121
+
if (appears_to_be_wayland(xdpy)) {
122
+
fprintf(stderr, "The X server at %s appears to be XWayland. Unfortunately, XWayland does not correctly support the features used by libxdo and xdotool.\n", display);
123
+
returnNULL;
124
+
}
125
+
126
+
109
127
/* XXX: Check for NULL here */
110
128
xdo=malloc(sizeof(xdo_t));
111
129
memset(xdo, 0, sizeof(xdo_t));
@@ -2017,3 +2035,24 @@ int xdo_get_viewport_dimensions(xdo_t *xdo, unsigned int *width,
0 commit comments