input: Add pointer-emulation grab for tablet tools

This commit is contained in:
Victoria Brekenfeld 2026-08-18 19:12:06 +02:00 • committed by Victoria Brekenfeld
parent 6467f79025
commit 9125f8a2a7
3 changed files with 351 additions and 23 deletions

View file

@ -33,8 +33,8 @@ use smithay::{
Tablet,
tool::{
AxisFrame as ToolAxisFrame, ButtonEvent as ToolButtonEvent,
DownEvent as ToolDownEvent, MotionEvent as ToolMotionEvent, TabletToolTarget,
UpEvent as ToolUpEvent,
DownEvent as ToolDownEvent, MotionEvent as ToolMotionEvent, TabletToolHandle,
TabletToolTarget, UpEvent as ToolUpEvent,
},
},
touch::{
@ -306,6 +306,16 @@ impl PointerFocusTarget {
session.set_cursor_hotspot(cursor_hotspot);
}
}
pub fn supports_tool(&self, tool_handle: &TabletToolHandle<State>) -> bool {
match self {
Self::WlSurface { surface, .. } if surface.client().is_some() => tool_handle
.client_tools(&surface.client().unwrap())
.next()
.is_some(),
_ => true,
}
}
}
impl KeyboardFocusTarget {