mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Only allow root pipelines to set the window title.
Sometimes, the root pipeline title is sent before the compositor has created the root pipeline, so also request the main page title once the initial frame tree has been sent.
This commit is contained in:
parent
fed878710c
commit
2517bb561a
1 changed files with 8 additions and 2 deletions
|
@ -288,6 +288,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
response_chan,
|
||||
new_constellation_chan);
|
||||
self.send_viewport_rects_for_all_layers();
|
||||
self.get_title_for_main_frame();
|
||||
}
|
||||
|
||||
(Msg::ChangeLayerPipelineAndRemoveChildren(old_pipeline, new_pipeline, response_channel),
|
||||
|
@ -431,8 +432,13 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
}
|
||||
}
|
||||
|
||||
fn change_page_title(&mut self, _: PipelineId, title: Option<String>) {
|
||||
self.window.set_page_title(title);
|
||||
fn change_page_title(&mut self, pipeline_id: PipelineId, title: Option<String>) {
|
||||
let set_title = self.root_pipeline.as_ref().map_or(false, |root_pipeline| {
|
||||
root_pipeline.id == pipeline_id
|
||||
});
|
||||
if set_title {
|
||||
self.window.set_page_title(title);
|
||||
}
|
||||
}
|
||||
|
||||
fn change_page_load_data(&mut self, _: FrameId, load_data: LoadData) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue