From 3231f12708d87b3440cf74ffaf0e46e053b07497 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 9 Apr 2014 20:07:16 -0700 Subject: [PATCH] Don't reuse an old pipeline for a new root layer When navigating to a new URL, we need to make sure compositor messages go to the new page's pipeline, not the previous one. --- src/components/main/compositing/compositor.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/main/compositing/compositor.rs b/src/components/main/compositing/compositor.rs index 9ae6520c38a..dcb6f94199e 100644 --- a/src/components/main/compositing/compositor.rs +++ b/src/components/main/compositing/compositor.rs @@ -354,16 +354,15 @@ impl IOCompositor { self.constellation_chan = new_constellation_chan; } - // FIXME(pcwalton): Take the pipeline ID into account. fn create_root_compositor_layer_if_necessary(&mut self, - _: PipelineId, + id: PipelineId, layer_id: LayerId, size: Size2D) { let (root_pipeline, root_layer_id) = match self.compositor_layer { - Some(ref compositor_layer) => { + Some(ref compositor_layer) if compositor_layer.pipeline.id == id => { (compositor_layer.pipeline.clone(), compositor_layer.id_of_first_child()) } - None => { + _ => { match self.root_pipeline { Some(ref root_pipeline) => (root_pipeline.clone(), LayerId::null()), None => fail!("Compositor: Received new layer without initialized pipeline"),