mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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
|
@ -27,7 +27,7 @@ use canvas_traits::webgl::WebGLPipeline;
|
|||
use compositor::ScrollTreeNodeId;
|
||||
use crossbeam_channel::{Receiver, RecvTimeoutError, Sender};
|
||||
use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId};
|
||||
use embedder_traits::Cursor;
|
||||
use embedder_traits::{CompositorEventVariant, Cursor};
|
||||
use euclid::default::Point2D;
|
||||
use euclid::{Length, Rect, Scale, Size2D, UnknownUnit, Vector2D};
|
||||
use gfx_traits::Epoch;
|
||||
|
@ -571,6 +571,21 @@ pub enum CompositorEvent {
|
|||
IMEDismissedEvent,
|
||||
}
|
||||
|
||||
impl From<&CompositorEvent> for CompositorEventVariant {
|
||||
fn from(value: &CompositorEvent) -> Self {
|
||||
match value {
|
||||
CompositorEvent::ResizeEvent(..) => CompositorEventVariant::ResizeEvent,
|
||||
CompositorEvent::MouseButtonEvent(..) => CompositorEventVariant::MouseButtonEvent,
|
||||
CompositorEvent::MouseMoveEvent(..) => CompositorEventVariant::MouseMoveEvent,
|
||||
CompositorEvent::TouchEvent(..) => CompositorEventVariant::TouchEvent,
|
||||
CompositorEvent::WheelEvent(..) => CompositorEventVariant::WheelEvent,
|
||||
CompositorEvent::KeyboardEvent(..) => CompositorEventVariant::KeyboardEvent,
|
||||
CompositorEvent::CompositionEvent(..) => CompositorEventVariant::CompositionEvent,
|
||||
CompositorEvent::IMEDismissedEvent => CompositorEventVariant::IMEDismissedEvent,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Requests a TimerEvent-Message be sent after the given duration.
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct TimerEventRequest(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue