iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
24.32k stars 1.13k forks source link

Wayland touch support is shoddy #1392

Open bansheerubber opened 2 years ago

bansheerubber commented 2 years ago

Is there an existing issue for this?

Is this issue related to iced?

What happened?

There is an issue with the current version of rust-windowing/winit that prevents touch support from functioning properly in Wayland (see https://github.com/rust-windowing/winit/issues/1996). Tapping a button will not correctly fire the button's on_press message since iced_winit isn't receiving correct location data. I found that if I touched the button, moved my finger along the button, and then released, the button would function properly.

A fix has been merged into the winit upstream that fixes this issue. The fix is currently unreleased and I'm not sure what the timeline on it is. I forked iced-rs/winit and cherry-picked the PR since I don't want this issue to delay my hobby project, and I can confirm that this PR fixes the issue I was experiencing.

The reason I'm posting this is to add to the knowledge base regarding this problem. This had me stumped for a few hours today.

What is the expected behavior?

Expect button tapping to fire the button's on_press message.

Version

0.4

Operative System

Linux

Do you have any log output?

No response

wyatt-herkamp commented 2 years ago

@bansheerubber could you try https://github.com/iced-rs/iced/pull/1410. This updates to the winit version to 0.27.

AlistairKeiller commented 1 month ago

I am on 0.12.1 (which would have winit=0.29), and I still have this issue. Running Weston, weston-simple-touch works perfectly, however my iced application does not fire on_press correctly.