mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Add minibrowser update on window resize event (#32067)
* Add minibrowser update on resize event * Give a more clear reason
This commit is contained in:
parent
5083f3c4fb
commit
5083dc7d17
1 changed files with 10 additions and 0 deletions
|
@ -246,6 +246,16 @@ impl App {
|
||||||
},
|
},
|
||||||
winit::event::Event::WindowEvent { ref event, .. } => {
|
winit::event::Event::WindowEvent { ref event, .. } => {
|
||||||
let response = minibrowser.on_event(event);
|
let response = minibrowser.on_event(event);
|
||||||
|
// Update minibrowser if there's resize event to sync up with window.
|
||||||
|
if let WindowEvent::Resized(_) = event {
|
||||||
|
minibrowser.update(
|
||||||
|
window.winit_window().unwrap(),
|
||||||
|
&mut app.webviews.borrow_mut(),
|
||||||
|
app.servo.as_ref().unwrap().offscreen_framebuffer_id(),
|
||||||
|
"Sync WebView size with Window Resize event",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if response.repaint {
|
if response.repaint {
|
||||||
// Request a winit redraw event, so we can recomposite, update and paint
|
// Request a winit redraw event, so we can recomposite, update and paint
|
||||||
// the minibrowser, and present the new frame.
|
// the minibrowser, and present the new frame.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue