Dispatch source hit testing for native pointer clicks
Verify Tessera GUI / verify (push) Failing after 7m31s
Verify Tessera GUI / verify (push) Failing after 7m31s
This commit is contained in:
+30
-5
@@ -143,23 +143,45 @@ impl RenderCache {
|
||||
}
|
||||
path.remove(&data_ref);
|
||||
let mut protocol_key = String::new();
|
||||
let mut custom_event = false;
|
||||
if let Some(definition) = store.type_of(block)? {
|
||||
protocol_key.push_str(&definition.to_string());
|
||||
for name in ["measure", "arrange", "paint", "hitTest"] {
|
||||
for name in ["measure", "arrange", "paint", "hitTest", "onEvent"] {
|
||||
if let Some(method) = store.lookup_method(definition, name)? {
|
||||
protocol_key.push_str(&format!("/{method}"));
|
||||
}
|
||||
}
|
||||
let event = store.lookup_method(definition, "onEvent")?;
|
||||
let mut native_event = None;
|
||||
let mut current = Some(definition);
|
||||
while let Some(definition) = current {
|
||||
dependencies.push(Dependency {
|
||||
object: definition,
|
||||
property: None,
|
||||
});
|
||||
current = store
|
||||
.payload::<endor_core::EndorTypeObject>(definition, "Type")?
|
||||
.base();
|
||||
let item = store.payload::<endor_core::EndorTypeObject>(definition, "Type")?;
|
||||
if item.name() == "Block"
|
||||
&& item.base().is_some_and(|base| {
|
||||
store
|
||||
.payload::<endor_core::EndorTypeObject>(base, "Type")
|
||||
.is_ok_and(|base| base.base().is_none())
|
||||
})
|
||||
{
|
||||
native_event = store.lookup_method(definition, "onEvent")?;
|
||||
}
|
||||
current = item.base();
|
||||
}
|
||||
custom_event = event.is_some() && event != native_event;
|
||||
}
|
||||
let mut click_connection = false;
|
||||
for connection in &data.subscriptions {
|
||||
dependencies.push(Dependency {
|
||||
object: *connection,
|
||||
property: None,
|
||||
});
|
||||
let item = store
|
||||
.payload::<crate::event_dispatch::Connection>(*connection, "Connection")?;
|
||||
click_connection |= item.kind == "click" && item.handler.is_some();
|
||||
}
|
||||
let children = values.split_off(values.len() - data.children.len());
|
||||
let kind = match &data.kind {
|
||||
@@ -226,7 +248,10 @@ impl RenderCache {
|
||||
block_id: block.to_string(),
|
||||
protocol_key,
|
||||
slots: data.children.iter().map(|c| c.slot).collect(),
|
||||
interactive: matches!(&data.kind, Kind::Button) || data.click.is_some(),
|
||||
interactive: matches!(&data.kind, Kind::Button)
|
||||
|| data.click.is_some()
|
||||
|| click_connection
|
||||
|| custom_event,
|
||||
kind,
|
||||
};
|
||||
let old = self.remove(block);
|
||||
|
||||
Reference in New Issue
Block a user