diff options
-rw-r--r-- | src/components/main/compositing/mod.rs | 5 | ||||
-rw-r--r-- | src/components/main/constellation.rs | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/components/main/compositing/mod.rs b/src/components/main/compositing/mod.rs index b13c5cbc8d0..b45cbad2197 100644 --- a/src/components/main/compositing/mod.rs +++ b/src/components/main/compositing/mod.rs @@ -141,7 +141,7 @@ pub enum Msg { /// Alerts the compositor to the current status of rendering. ChangeRenderState(RenderState), /// Sets the channel to the current layout and render tasks, along with their id - SetIds(SendableFrameTree), + SetIds(SendableFrameTree, Chan<()>), } /// Azure surface wrapping to work with the layers infrastructure. @@ -345,8 +345,9 @@ impl CompositorTask { ChangeReadyState(ready_state) => window.set_ready_state(ready_state), ChangeRenderState(render_state) => window.set_render_state(render_state), - SetIds(frame_tree) => { + SetIds(frame_tree, response_chan) => { pipeline = Some(frame_tree.pipeline); + response_chan.send(()); } GetSize(chan) => { diff --git a/src/components/main/constellation.rs b/src/components/main/constellation.rs index 7c1c8a1fa50..4ffe5e3230d 100644 --- a/src/components/main/constellation.rs +++ b/src/components/main/constellation.rs @@ -514,10 +514,12 @@ impl Constellation { // TODO(tkuehn): In fact, this kind of message might be provably // impossible to occur. if current_frame.contains(pipeline_id) { + let (port, chan) = comm::stream(); + self.compositor_chan.send(SetIds(current_frame.to_sendable(), chan)); + port.recv(); for current_frame.iter().advance |frame| { frame.pipeline.grant_paint_permission(); } - self.compositor_chan.send(SetIds(current_frame.to_sendable())); return true; } } @@ -606,7 +608,9 @@ impl Constellation { // Grants a frame tree permission to paint; optionally updates navigation to reflect a new page fn grant_paint_permission(&mut self, frame_tree: @mut FrameTree) { // Give permission to paint to the new frame and all child frames - self.compositor_chan.send(SetIds(frame_tree.to_sendable())); + let (port, chan) = comm::stream(); + self.compositor_chan.send(SetIds(frame_tree.to_sendable(), chan)); + port.recv(); for frame_tree.iter().advance |frame| { frame.pipeline.grant_paint_permission(); } |