mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +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
|
@ -1548,9 +1548,10 @@ where
|
|||
|
||||
fn handle_request_from_script(&mut self, message: (PipelineId, FromScriptMsg)) {
|
||||
let (source_pipeline_id, content) = message;
|
||||
debug!(
|
||||
trace!(
|
||||
"{}: Message from pipeline: {:?}",
|
||||
source_pipeline_id, content,
|
||||
source_pipeline_id,
|
||||
content,
|
||||
);
|
||||
|
||||
let source_top_ctx_id = match self
|
||||
|
@ -2904,15 +2905,23 @@ where
|
|||
self.pressed_mouse_buttons = 0;
|
||||
}
|
||||
|
||||
let msg = ConstellationControlMsg::SendEvent(destination_pipeline_id, event);
|
||||
let result = match self.pipelines.get(&destination_pipeline_id) {
|
||||
let pipeline = match self.pipelines.get(&destination_pipeline_id) {
|
||||
None => {
|
||||
debug!("{}: Got event after closure", destination_pipeline_id);
|
||||
return;
|
||||
},
|
||||
Some(pipeline) => pipeline.event_loop.send(msg),
|
||||
Some(pipeline) => pipeline,
|
||||
};
|
||||
if let Err(e) = result {
|
||||
|
||||
self.embedder_proxy.send((
|
||||
Some(pipeline.top_level_browsing_context_id),
|
||||
EmbedderMsg::EventDelivered((&event).into()),
|
||||
));
|
||||
|
||||
if let Err(e) = pipeline.event_loop.send(ConstellationControlMsg::SendEvent(
|
||||
destination_pipeline_id,
|
||||
event,
|
||||
)) {
|
||||
self.handle_send_error(destination_pipeline_id, e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue