Skip to content

xi: Don't deliver emulated motion when there's no owner for touch end

Pointer-emulated touch events should only be delivered to the client that owns the sequence even if it's a core client that became the effective owner of the sequency by selecting for pointer press and movement.

Currently the emulated events are delivered like this already (see TouchResourceIsOwner() check in DeliverEmulatedMotionEvent()), except in the case of TouchEnd, in which case the generated motion event is still delivered to some client that's not necessarily the owner of the touch sequence.

We already know whether a touch sequence that is about to emulate a pointer event has an owner, we just need to check that. This further allows to simplify DeliverEmulatedMotionEvent() as it won't ever be called for non-owned touch events.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=60394

This MR fixes the following test from xorg-integration-tests:

  • TouchTestXI2Version.NoEmulatedButton1MotionWithoutButtonPress

Additionally, DeviceChangedTest.DeviceChangedEvent needed changes to adjust to the new behavior of the server. Previously it expected emulated events when only selecting for XI_Motion. At this moment there's no MR for the changes as they depend on other MRs that have not yet landed.

cc @whot

Edited by Povilas Kanapickas

Merge request reports

Loading