not-fl3 / macroquad

Cross-platform game engine in Rust.
Apache License 2.0
3.23k stars 313 forks source link

Touchscreen mouse emulation doesn't seem to work well on Linux #463

Open vpzomtrrfrt opened 2 years ago

vpzomtrrfrt commented 2 years ago

Observed under Arch Linux, Xorg, i3, on a ThinkPad Yoga 11e

I'm not sure how to tell if the touch events are even reaching macroquad or if some other layer is failing here.

Reproduction Steps

The rustaceans appear at the position of the cursor as it moves.

The rustaceans appear only at the start point and continue to be added after letting up.

bolphen commented 2 months ago

The issue still persists and I think the culprit is here https://github.com/not-fl3/macroquad/blob/471f5b7b359ec71c89f97e765784b722fc87d4dc/src/lib.rs#L687 I'm not sure what exactly set_cursor_grab is doing, but that line is causing all the mouse_motion events and mouse_button_up event being ignored (but only for the mouse emulated by touchscreen). Commenting out that line seems to resolve the issue, but I don't know what other side effects it might have...