Xwayland can skip sending the first events to ei
While setting up ei events are queued, when EI_EVENT_DEVICE_RESUMED
they are dequeued. However an eis implementation will typically use multiple devices with disjoint capabilities. This can lead to not sending events through ei and falling back to xtest
Consider the following events:
xdotool key p
- the event is queued
- ei connection setup
- compositor adds a device with
EIS_DEVICE_CAP_POINTER
, callseis_device_add
andeis_device_resume
- compositor adds a device with
EIS_DEVICE_CAP__POINTER_KEYBOARD
, callseis_device_add
andeis_device_resume
- Xwayland processes events, sees
EI_EVENT_DEVICE_RESUMED
and starts dequeuing events - the current implementation thinks key events are not accepted because there is no keyboard device and sends it through xtest
(Note the same would happen if the compositor would have added all devices first and then resumed all devices)