Event to make a browser visible

This commit is contained in:
Paul Rouget 2017-07-15 07:36:31 +02:00
parent 6876e42d66
commit d9e7bdd7f6
4 changed files with 32 additions and 2 deletions

View file

@ -825,6 +825,13 @@ impl<Window: WindowMethods> IOCompositor<Window> {
warn!("Sending NewBrowser message to constellation failed ({}).", e);
}
}
WindowEvent::SelectBrowser(ctx) => {
let msg = ConstellationMsg::SelectBrowser(ctx);
if let Err(e) = self.constellation_chan.send(msg) {
warn!("Sending SelectBrowser message to constellation failed ({}).", e);
}
}
}
}

View file

@ -73,6 +73,9 @@ pub enum WindowEvent {
Reload(TopLevelBrowsingContextId),
/// Create a new top level browsing context
NewBrowser(ServoUrl, IpcSender<TopLevelBrowsingContextId>),
/// Make a top level browsing context visible, hiding the previous
/// visible one.
SelectBrowser(TopLevelBrowsingContextId),
}
impl Debug for WindowEvent {
@ -96,6 +99,7 @@ impl Debug for WindowEvent {
WindowEvent::ToggleWebRenderProfiler => write!(f, "ToggleWebRenderProfiler"),
WindowEvent::Reload(..) => write!(f, "Reload"),
WindowEvent::NewBrowser(..) => write!(f, "NewBrowser"),
WindowEvent::SelectBrowser(..) => write!(f, "SelectBrowser"),
}
}
}