mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
constellation: notify embedder when events are hit-tested to browsers (#30841)
* constellation: notify embedder when events are hit-tested to browsers * fix compile error in libsimpleservo * impl From<&CompositorEvent> for CompositorEventVariant * remove msg temporaries in Constellation::forward_event * use single wildcard arm in EventDelivered case in handle_servo_events
This commit is contained in:
parent
676c170b07
commit
8a226fdb19
5 changed files with 58 additions and 10 deletions
|
@ -208,6 +208,21 @@ pub enum EmbedderMsg {
|
|||
OnDevtoolsStarted(Result<u16, ()>, String),
|
||||
/// Compositing done, but external code needs to present.
|
||||
ReadyToPresent,
|
||||
/// The given event was delivered to a pipeline in the given browser.
|
||||
EventDelivered(CompositorEventVariant),
|
||||
}
|
||||
|
||||
/// The variant of CompositorEvent that was delivered to a pipeline.
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum CompositorEventVariant {
|
||||
ResizeEvent,
|
||||
MouseButtonEvent,
|
||||
MouseMoveEvent,
|
||||
TouchEvent,
|
||||
WheelEvent,
|
||||
KeyboardEvent,
|
||||
CompositionEvent,
|
||||
IMEDismissedEvent,
|
||||
}
|
||||
|
||||
impl Debug for EmbedderMsg {
|
||||
|
@ -245,6 +260,7 @@ impl Debug for EmbedderMsg {
|
|||
EmbedderMsg::OnDevtoolsStarted(..) => write!(f, "OnDevtoolsStarted"),
|
||||
EmbedderMsg::ShowContextMenu(..) => write!(f, "ShowContextMenu"),
|
||||
EmbedderMsg::ReadyToPresent => write!(f, "ReadyToPresent"),
|
||||
EmbedderMsg::EventDelivered(..) => write!(f, "HitTestedEvent"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue