Implement zwlr_virtual_pointer_v1 and zwp_virtual_keyboard_v1 for better pointer and keyboard support on monitor overlays#539
Open
SparkyTD wants to merge 3 commits into
Open
Conversation
…_keyboard_v1, and only use uinput as a fallback
galister
reviewed
Jun 21, 2026
Comment on lines
+21
to
+24
| let (provider, toast) = hid::provider::wl_virtual::initialize_wl_virtual() | ||
| .or_else(|_| hid::provider::uinput::initialize_uinput()) | ||
| .map(|provider| (provider, None)) | ||
| .unwrap_or_else(|toast| (Box::new(DummyProvider {}), Some(toast))); |
Collaborator
There was a problem hiding this comment.
we only know how it behaves on hyprland so it should not be the default method
Author
There was a problem hiding this comment.
On any environment that doesn't support those protocols, it will silently fall back to the old uinput method. So far I've tested it on KDE and Ubuntu, and there are no unexpected crashes, the code behaves as it did before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the wayland protocols zwlr_virtual_pointer_v1 and zwp_virtual_keyboard_v1 as an optional replacement for the current UInput method for better overlay input support on Wayland. On desktops that do not implement these protocols, the code still falls back to the existing UInput logic.
This solves an issue caused by the input event handling logic on certain desktops (e.g. Hyprland), where pointer motion events aren't being correctly forwarded to the focused application, which results in pointer "jumping" on clicks, accidental drag selections, and overall poor usability
The protocols implemented by this PR are made specifically for this use, and they provide a more stable, Wayland-firendly and idiomatic way of controlling the pointer and a mouse.