rust-windowing / rust-windowing/winit
double MouseMotion events when cursor grab mode is Confined, while using X11
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
seems to be caused by set_cursor_mode in platform_impl/linux/x11/window.rs calling XGrabPointer with ffi::True as the 3rd (owner_events) argument.
to re-produce:
try the cursor_grab.rs example with CursorGrabMode::None, and then with CursorGrabMode::Confined.
echo focus the cursor_grab.rs example window now
gcc -o send_event send_event.c -lX11 -lXtst
sleep 1
./send_event
#include <X11/Xlib.h>
#include <X11/extensions/XTest.h>
int main(void) {
Display *display = XOpenDisplay(NULL);
XTestFakeRelativeMotionEvent(display, 255, 255, 0);
XFlush(display);
XCloseDisplay(display);
return 0;
}
this is inconsistent with the wayland impl (and it leads to inconsistencies in camera sensitivity for example)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in platform_impl/linux/x11/window.rs at set_cursor_mode and reproduce the behavior with the cursor_grab.rs example using CursorGrabMode::None and CursorGrabMode::Confined. Compare the X11 pointer-grab behavior with the Wayland implementation, then verify that confined mode no longer produces duplicate mouse-motion events or inconsistent camera sensitivity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100