Touch: fingers reach apps as wl_touch, so a thumb scrolls
Every touch was turned into a mouse drag in the seat code, which selects text instead of scrolling. The seat now reports raw touches and the compositor routes them: to the app as wl_touch on its own content, and to the pointer (tap, drag, hold for right click, as before) everywhere else and for apps that don't listen to touches. The cursor is hidden while fingers are in use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
98a99aaa36
commit
e30d9cc71f
17 files changed
+786
-126
No files matched your search
@@ -769,6 +769,20 @@ pub fn ChandraCompositor::control_command(
|
||||
_ => (["error invalid button args"], false)
|
||||
}
|
||||
}
|
||||
"input-touch" => {
|
||||
// A finger, as the touchscreen would report it (docs/handset.md).
|
||||
let usage = (["error usage: input-touch down|motion ID X Y | up ID | cancel"], false)
|
||||
let args = words[1:].to_array().map(parse_int_opt)
|
||||
let ev : @nested.TouchEvent = match (words.get(1), args) {
|
||||
(Some("down"), [_, Some(id), Some(x), Some(y)]) => Down(id, x.to_double(), y.to_double())
|
||||
(Some("motion"), [_, Some(id), Some(x), Some(y)]) => Motion(id, x.to_double(), y.to_double())
|
||||
(Some("up"), [_, Some(id)]) => Up(id)
|
||||
(Some("cancel"), [_]) => Cancel
|
||||
_ => return usage
|
||||
}
|
||||
self.handle_input(Touch(ev), @sys.monotonic_ms().to_uint())
|
||||
(["ok"], true)
|
||||
}
|
||||
"input-scroll" => {
|
||||
if words.length() != 4 {
|
||||
return (["error usage: input-scroll AXIS VAL DISCRETE"], false)
|
||||
|
||||
Reference in new issue
Block a user