The major problem with adding true rawinput support is that there is no way suppress auto-generating rawinput events on normal motion events. We end up with the normal "accelerated" motion being translated to relative input and xinput2 clashing with that. We really just want the "unaccelerated" input and thus need to prevent a normal motion event from generating rawinput.
This patch set does two main things: - Add plumbing to server to allow graphics driver to prevent the server from making rawinput from INPUT_MOUSE and INPUT_KEYBOARD events so a graphics driver can inject its own INPUT_HARDWARE events with impunity. - Major refactor for x11drv xinput2 (listen for events based on focus, use raw unaccelerated values for XI_RawMotion)
I have a version of this patch that is a minimal diff to the x11drv xinput2 handler (maybe I got carried away here...), but I think it might be better to focus on the send_hardware_message() plumbing to make sure it is good for other graphics drivers.
Tested on XWayland only with MouseTester.exe (https://github.com/microe1/MouseTester/releases) and Quake Live (ported this set of patches to proton).
-- v5: x11drv: lets get raw input really working rawinput: add trace and avoid re-processing