Wayland: virtual pointer and keyboard are optional; capture still starts (#72, #73)

Compositors without wlr-virtual-pointer, or that restrict the virtual keyboard to their input method (Denial), now bring up capture and fall back to uinput for input. UU_WAYLAND_NO_VIRTUAL_KEYBOARD=1 skips the virtual keyboard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ossSBandClaude Opus 5.5 authored and GitHub committed 2026-10-21 16:29:19 +08:00
1 parent 25893cd4ab
commit c739036301
2 files changed
+61 -35

No files matched your search

+5 -2
View File
@@ -328,9 +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 {
return crate::wayland::move_pointer(x,y,false);
if !relative && self.backend==crate::desktop_backend::DesktopBackend::Wayland
&& crate::wayland::move_pointer(x,y,false)==0 {
return 0;
}
// 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();