mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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.
This commit is contained in:
parent
9c3875ead5
commit
3231f12708
1 changed files with 3 additions and 4 deletions
|
@ -354,16 +354,15 @@ impl IOCompositor {
|
||||||
self.constellation_chan = new_constellation_chan;
|
self.constellation_chan = new_constellation_chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(pcwalton): Take the pipeline ID into account.
|
|
||||||
fn create_root_compositor_layer_if_necessary(&mut self,
|
fn create_root_compositor_layer_if_necessary(&mut self,
|
||||||
_: PipelineId,
|
id: PipelineId,
|
||||||
layer_id: LayerId,
|
layer_id: LayerId,
|
||||||
size: Size2D<f32>) {
|
size: Size2D<f32>) {
|
||||||
let (root_pipeline, root_layer_id) = match self.compositor_layer {
|
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())
|
(compositor_layer.pipeline.clone(), compositor_layer.id_of_first_child())
|
||||||
}
|
}
|
||||||
None => {
|
_ => {
|
||||||
match self.root_pipeline {
|
match self.root_pipeline {
|
||||||
Some(ref root_pipeline) => (root_pipeline.clone(), LayerId::null()),
|
Some(ref root_pipeline) => (root_pipeline.clone(), LayerId::null()),
|
||||||
None => fail!("Compositor: Received new layer without initialized pipeline"),
|
None => fail!("Compositor: Received new layer without initialized pipeline"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue