From 2517bb561a09fc16adfd348d80cee81bc61151c4 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Mon, 2 Mar 2015 16:03:01 +1000 Subject: [PATCH] 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. --- components/compositing/compositor.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 3ed89b37604..2e258545070 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -288,6 +288,7 @@ impl IOCompositor { 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 IOCompositor { } } - fn change_page_title(&mut self, _: PipelineId, title: Option) { - self.window.set_page_title(title); + fn change_page_title(&mut self, pipeline_id: PipelineId, title: Option) { + 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) {