Wayland: only a missing virtual pointer falls back to uinput (#78)

uu_wl_move returns -2 only when the compositor has no wlr-virtual-pointer; other failures are returned as before. Document UU_WAYLAND_NO_VIRTUAL_KEYBOARD.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
VallierDevandClaude Opus 5.5 authored and GitHub committed 2026-10-21 21:05:11 +08:00
1 parent c739036301
commit b1da297e42
4 files changed
+9 -9

No files matched your search

+5 -5
View File
@@ -328,12 +328,12 @@ impl InputInjector {
// uinput ABS axes span the compositor's whole desktop. A captured output
// uses its own pixel space; bind absolute motion to that Wayland output,
// including when uinput remains in use for keyboard/buttons/relative input.
if !relative && self.backend==crate::desktop_backend::DesktopBackend::Wayland
&& crate::wayland::move_pointer(x,y,false)==0 {
return 0;
// Only a compositor without wlr-virtual-pointer (-2) falls through to the uinput
// absolute pointer; an out-of-range point must not land on another output.
if !relative && self.backend==crate::desktop_backend::DesktopBackend::Wayland {
let result=crate::wayland::move_pointer(x,y,false);
if result!=-2 { return result; }
}
// Compositors without wlr-virtual-pointer reject absolute motion here; fall
// through to the uinput absolute pointer instead of reporting a phantom success.
if let Some(uinput)=&self.uinput {
if relative { return Self::uinput_result(uinput.move_relative(x,y)); }
let (w,h)=*self.screen.lock().unwrap();