libservo: Remove EmbedderEvent::WindowResize (#35277)

Remove this event which is completely unused. In addition, lots of code
becomes dead once this happens, so remove that as well. It may be
possible that a different behavior is necessary immediately following a
window resize, but the new API will handle this in a different way than
this embedder event -- which complicates how the event loop is spun in
both the API and servoshell.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-02-04 09:37:25 +01:00 committed by GitHub
parent c94ac5bccb
commit d5daa31b1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 42 deletions

View file

@ -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 dont, so there wont 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");