rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.89k stars 914 forks source link

Remove non-platform-consistent mouse events from X11 #3874

Open daxpedda opened 3 months ago

daxpedda commented 3 months ago

Currently X11 will emit a WindowEvent::CursorMoved when the window comes into focus, even if e.g. the cursor isn't inside the window. This is inconsistent with other platforms and can also be a bit misleading to users. I believe in the future, we should use CursorEntered/CursorLeft on focus and unfocus on all backends to make this idea work properly. Emitting the cursor position in these events will be handled by #3833.

~~The other case, is X11 emitting a WindowEvent::CursorMoved on the first touch point made in a touch interaction. I believe the idea behind this is to signify the user that the cursor has jumped to this location. However, this can again be misinterpreted by users and is not consistent between platforms. We are also unable to express this sort of pointer vs touch vs cursor with the current API, which would need its own separate discussion and motivation first.~~

I've encountered this while working on #3810 and #3833.