Skip to content

X11: Mouse motion events sometimes contain garbage #3500

@valaphee

Description

@valaphee

While printing out events on X11, I noticed that sometimes (not always), the motion events are invalid:

DeviceEvent { device_id: DeviceId(X(DeviceId(2))), event: Motion { axis: 0, value: -1.0 } }
DeviceEvent { device_id: DeviceId(X(DeviceId(2))), event: Motion { axis: 1, value: 7.1e-322 } }
DeviceEvent { device_id: DeviceId(X(DeviceId(2))), event: MouseMotion { delta: (-1.0, 7.1e-322) } }

Only one axis gets reported and the second axis is just an unrelated value (most likely smth not belonging to the event).

for i in 0..xev.valuators.mask_len * 8 {
    if !xinput2::XIMaskIsSet(mask, i) {
        continue;
    }
    let x = unsafe { *value };

The easiest way I found to reproduce this is just moving the cursor between two monitors. It might also just be a x11 problem.

I'm running natively latest Arch Linux with Gnome using X11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DS - x11Affects the X11 backend, or generally free Unix platforms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions