rust-windowing / rust-windowing/winit
X11: Allow for grabbing individual inputs instead of setting entire input focus
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
Currently, winit always does XSetInputFocus (if the window is visible). However, it doesn't allow for more delicate control over which inputs to grab. In X11, there are many ways to grab input.
For instance, I would like to implement something like rofi using winit but that is currently a bit cumbersome because I'd need XGrabPointer and XGrabKeyboard individually without receiving the whole window focus. In fact, I don't even want my input to be focused onto the new window. Perhaps this could be solved by providing a few new methods on the WindowBuilder such as .with_set_focus(bool) (default true), .with_grab_keyboard(bool) (default false), .with_grab_mouse(bool) (default false).
This and #646 would solve #403, I think.
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 with the WindowBuilder focus behavior described in the issue and inspect the X11 handling around XSetInputFocus. Compare the proposed with_set_focus, with_grab_keyboard, and with_grab_mouse options with XGrabPointer and XGrabKeyboard. Done means defining and implementing a suitable API without forcing whole-window focus, with coverage for the relevant behaviors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100