Attempting to send a synthetic XInput2 event through XSendEvent() fails with a BadValue error: Display display = /* ... */; Window window = /* ... */; XIDeviceEvent event = { .type = GenericEvent, .display = display, .extension = xinput2_opcode, .evtype = XI_TouchBegin, /* ... */ }; XSendEvent(display, window, False, 0, (XEvent *)&event); // => BadValue The same happens if I try to wrap the XIDeviceEvent in an XGenericEventCookie: XGenericEventCookie cookie; memcpy(&cookie, &event, sizeof(cookie)); cookie.cookie = 0; cookie.data = &event; XSendEvent(display, window, False, 0, (XEvent *)&cookie); // => BadValue This issue appears to have been raised previously in bug 30357 (through 30361), but despite that being marked FIXED, XSendEvent() still fails with xorg-server 1.17.1, libX11 1.6.2, and libXi 1.7.4, and I don't see that any of the patches from those bugs have been applied. FWIW, after applying those patches (with minor tweaks) I can successfully send wrapped XIDeviceEvent events through XSendEvent().
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libx11/issues/42.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.