diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index ef6553f1775..442499c1eb5 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -51,8 +51,6 @@ pub enum EmbedderEvent { /// Sent when part of the window is marked dirty and needs to be redrawn. Before sending this /// message, the window must make the same GL context as in `PrepareRenderingEvent` current. Refresh, - /// Sent when the window is resized. - WindowResize, /// Sent when the platform theme changes. ThemeChange(Theme), /// Sent when a navigation request from script is allowed/refused. @@ -142,7 +140,6 @@ impl Debug for EmbedderEvent { match *self { EmbedderEvent::Idle => write!(f, "Idle"), EmbedderEvent::Refresh => write!(f, "Refresh"), - EmbedderEvent::WindowResize => write!(f, "Resize"), EmbedderEvent::ThemeChange(..) => write!(f, "ThemeChange"), EmbedderEvent::Keyboard(..) => write!(f, "Keyboard"), EmbedderEvent::IMEComposition(..) => write!(f, "IMEComposition"), diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 94594e60945..be5e438439b 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -643,17 +643,13 @@ impl Servo { ) } - fn handle_window_event(&mut self, event: EmbedderEvent) -> bool { + fn handle_window_event(&mut self, event: EmbedderEvent) { match event { EmbedderEvent::Idle => {}, EmbedderEvent::Refresh => { self.compositor.borrow_mut().composite(); }, - - EmbedderEvent::WindowResize => { - return self.compositor.borrow_mut().on_rendering_context_resized(); - }, EmbedderEvent::ThemeChange(theme) => { let msg = ConstellationMsg::ThemeChange(theme); if let Err(e) = self.constellation_proxy.try_send(msg) { @@ -918,7 +914,6 @@ impl Servo { self.send_to_constellation(ConstellationMsg::Clipboard(clipboard_event)); }, } - false } fn send_to_constellation(&self, msg: ConstellationMsg) { @@ -955,21 +950,19 @@ impl Servo { self.messages_for_embedder.drain(..) } - pub fn handle_events(&mut self, events: impl IntoIterator) -> bool { + pub fn handle_events(&mut self, events: impl IntoIterator) { if self.compositor.borrow_mut().receive_messages() { self.receive_messages(); } - let mut need_resize = false; for event in events { trace!("servo <- embedder EmbedderEvent {:?}", event); - need_resize |= self.handle_window_event(event); + self.handle_window_event(event); } if self.compositor.borrow().shutdown_state != ShutdownState::FinishedShuttingDown { self.compositor.borrow_mut().perform_updates(); } else { self.messages_for_embedder.push(EmbedderMsg::Shutdown); } - need_resize } pub fn repaint_synchronously(&mut self) { diff --git a/ports/servoshell/desktop/app.rs b/ports/servoshell/desktop/app.rs index c69cf30a283..9643a1835f2 100644 --- a/ports/servoshell/desktop/app.rs +++ b/ports/servoshell/desktop/app.rs @@ -58,7 +58,6 @@ pub struct App { } enum Present { - Immediate, Deferred, None, } @@ -251,7 +250,6 @@ impl App { // Take any new embedder messages from Servo. let servo = self.servo.as_mut().expect("Servo should be running."); let mut embedder_messages: Vec<_> = servo.get_events().collect(); - let mut need_resize = false; let mut need_present = false; let mut need_update = false; loop { @@ -266,7 +264,8 @@ impl App { need_update |= servo_event_response.need_update; // Runs the compositor, and receives and collects embedder messages from various Servo components. - need_resize |= servo.handle_events(vec![]); + servo.handle_events(vec![]); + if self.webviews.shutdown_requested() { return PumpResult::Shutdown; } @@ -278,9 +277,7 @@ impl App { } } - let present = if need_resize { - Present::Immediate - } else if need_present { + let present = if need_present { Present::Deferred } else { Present::None @@ -322,24 +319,6 @@ impl App { } } match present { - Present::Immediate => { - // The window was resized. - trace!("PumpResult::Present::Immediate"); - - // If we had resized any of the viewports in response to this, we would need to - // call Servo::repaint_synchronously. At the moment we don’t, so there won’t be - // any paint scheduled, and calling it would hang the compositor forever. - if let Some(ref mut minibrowser) = self.minibrowser { - minibrowser.update( - window.winit_window().unwrap(), - &mut self.webviews, - self.servo.as_ref(), - "PumpResult::Present::Immediate", - ); - minibrowser.paint(window.winit_window().unwrap()); - } - self.servo.as_mut().unwrap().present(); - }, Present::Deferred => { // The compositor has painted to this frame. trace!("PumpResult::Present::Deferred"); @@ -385,11 +364,6 @@ impl App { }, PumpResult::Continue { present, .. } => { match present { - Present::Immediate => { - // The window was resized. - trace!("PumpResult::Present::Immediate"); - self.servo.as_mut().unwrap().present(); - }, Present::Deferred => { // The compositor has painted to this frame. trace!("PumpResult::Present::Deferred");