[server] Send frame event instead of flush on relative pointer motion

Authored by romangg on May 31 2018, 10:48 PM.



This solves for me not working relative pointer motion with grab/lock in
Xwayland applications.

Looking at the Xwayland code it is clear, that it expects a frame event on
wl_pointer versions 5 and above after relative motion events. wl_pointer
version 5 support was added to KWayland in b6bd28ab.

If the cursor is locked no absolute motion events are sent. In this case to
make sure relative motion events are processed by the client, send the frame
event after every relative motion.

BUG: 395815

Test Plan

Manually with Neverball in Xwayland mode.

Diff Detail

R127 KWayland
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
romangg created this revision.May 31 2018, 10:48 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 31 2018, 10:48 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
romangg requested review of this revision.May 31 2018, 10:48 PM
davidedmundson accepted this revision.Jun 25 2018, 11:00 AM
davidedmundson added a subscriber: davidedmundson.

You're matching the buttonReleased/buttonPressed/axis/etc events. So +2 for the immediate fix.

But longterm the point of sendFrame is to help batching so the current code of calling sendFrame in every send event is wrong and undermines the wayland design.
IMHO it needs to be either explicit from kwin, or alternatively some clever code here that only actually calls sendFrame once when we hit the event loop.

This revision is now accepted and ready to land.Jun 25 2018, 11:00 AM
romangg edited the summary of this revision. (Show Details)Jun 25 2018, 6:03 PM

Correct, in the end we want to combine input events and send them batched. For now the KWayland code does not allow this in general.

This revision was automatically updated to reflect the committed changes.