Dispatch source hit testing for native pointer clicks
Verify Tessera GUI / verify (push) Failing after 7m31s

This commit is contained in:
2026-10-21 15:37:26 +08:00
parent d19fab55b9
commit 7b11e32eb6
14 changed files with 560 additions and 30 deletions
+23 -1
View File
@@ -1,4 +1,4 @@
//! Native input transport. Only opaque frame/mount identities cross to the VM worker.
//! Native input transport. Frame/mount identities and optional logical pointer positions cross to the VM worker.
use serde::{Deserialize, Serialize};
use std::{
io::{Read, Write},
@@ -16,6 +16,28 @@ pub struct Input {
pub layout_version: u64,
pub mount: u64,
pub kind: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub point: Option<[f32; 2]>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub press_point: Option<[f32; 2]>,
}
impl Input {
pub fn validate(&self) -> Result<(), &'static str> {
match (self.point, self.press_point) {
(None, None) => Ok(()),
(Some(point), Some(press))
if self.kind == "click"
&& point
.into_iter()
.chain(press)
.all(|value| value.is_finite() && (0.0..=1_000_000.0).contains(&value)) =>
{
Ok(())
}
_ => Err("pointer click requires finite press/release coordinates"),
}
}
}
pub struct Client(SyncSender<Input>);