mirror of
https://github.com/servo/servo.git
synced 2025-08-13 09:25:32 +01:00
add reload keyboard shortcut
rename the preference to shell.builtin-key-shortcuts.enabled
This commit is contained in:
parent
053c2aee0a
commit
909f0da3c2
9 changed files with 57 additions and 4 deletions
|
@ -618,6 +618,10 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
debug!("constellation got webdriver command message");
|
||||
self.handle_webdriver_msg(command);
|
||||
}
|
||||
FromCompositorMsg::Reload => {
|
||||
debug!("constellation got reload message");
|
||||
self.handle_reload_msg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1421,6 +1425,24 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
|
|||
}
|
||||
}
|
||||
|
||||
fn handle_reload_msg(&mut self) {
|
||||
// Send Reload constellation msg to root script channel.
|
||||
let root_pipeline_id = self.root_frame_id
|
||||
.and_then(|root_frame_id| self.frames.get(&root_frame_id))
|
||||
.map(|root_frame| root_frame.current);
|
||||
|
||||
if let Some(pipeline_id) = root_pipeline_id {
|
||||
let msg = ConstellationControlMsg::Reload(pipeline_id);
|
||||
let result = match self.pipelines.get(&pipeline_id) {
|
||||
Some(pipeline) => pipeline.script_chan.send(msg),
|
||||
None => return debug!("Pipeline {:?} got reload event after closure.", pipeline_id),
|
||||
};
|
||||
if let Err(e) = result {
|
||||
self.handle_send_error(pipeline_id, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_get_pipeline_title_msg(&mut self, pipeline_id: PipelineId) {
|
||||
let result = match self.pipelines.get(&pipeline_id) {
|
||||
None => return self.compositor_proxy.send(ToCompositorMsg::ChangePageTitle(pipeline_id, None)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue