diff options
Diffstat (limited to 'components/compositing')
-rw-r--r-- | components/compositing/compositor.rs | 21 | ||||
-rw-r--r-- | components/compositing/lib.rs | 2 |
2 files changed, 19 insertions, 4 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 52c617fb0bd..1614f28b741 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -754,10 +754,15 @@ impl<Window: WindowMethods> IOCompositor<Window> { let initial_viewport = self.window_rect.size.to_f32() / dppx; - let msg = ConstellationMsg::WindowSize(WindowSizeData { + let data = WindowSizeData { device_pixel_ratio: dppx, initial_viewport: initial_viewport, - }, size_type); + }; + let top_level_browsing_context_id = match self.root_pipeline { + Some(ref pipeline) => pipeline.top_level_browsing_context_id, + None => return warn!("Window resize without root pipeline."), + }; + let msg = ConstellationMsg::WindowSize(top_level_browsing_context_id, data, size_type); if let Err(e) = self.constellation_chan.send(msg) { warn!("Sending window resize to constellation failed ({}).", e); @@ -866,7 +871,11 @@ impl<Window: WindowMethods> IOCompositor<Window> { } WindowEvent::Reload => { - let msg = ConstellationMsg::Reload; + let top_level_browsing_context_id = match self.root_pipeline { + Some(ref pipeline) => pipeline.top_level_browsing_context_id, + None => return warn!("Window reload without root pipeline."), + }; + let msg = ConstellationMsg::Reload(top_level_browsing_context_id); if let Err(e) = self.constellation_chan.send(msg) { warn!("Sending reload to constellation failed ({}).", e); } @@ -1338,7 +1347,11 @@ impl<Window: WindowMethods> IOCompositor<Window> { windowing::WindowNavigateMsg::Forward => TraversalDirection::Forward(1), windowing::WindowNavigateMsg::Back => TraversalDirection::Back(1), }; - let msg = ConstellationMsg::TraverseHistory(None, direction); + let top_level_browsing_context_id = match self.root_pipeline { + Some(ref pipeline) => pipeline.top_level_browsing_context_id, + None => return warn!("Sending navigation to constellation with no root pipeline."), + }; + let msg = ConstellationMsg::TraverseHistory(top_level_browsing_context_id, direction); if let Err(e) = self.constellation_chan.send(msg) { warn!("Sending navigation to constellation failed ({}).", e); } diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index 9b3fb8d9cda..e4307ff04cc 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -29,6 +29,7 @@ pub use compositor::IOCompositor; use euclid::size::TypedSize2D; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::PipelineId; +use msg::constellation_msg::TopLevelBrowsingContextId; use script_traits::{ConstellationControlMsg, LayoutControlMsg}; use style_traits::CSSPixel; @@ -48,6 +49,7 @@ pub struct SendableFrameTree { #[derive(Clone)] pub struct CompositionPipeline { pub id: PipelineId, + pub top_level_browsing_context_id: TopLevelBrowsingContextId, pub script_chan: IpcSender<ConstellationControlMsg>, pub layout_chan: IpcSender<LayoutControlMsg>, } |