Recreate Window::surface on SurfaceError::Lost
This commit is contained in:
parent
43a79130f6
commit
b06935b807
1 changed files with 14 additions and 5 deletions
|
|
@ -1021,11 +1021,20 @@ async fn run_instance<P>(
|
|||
let physical_size =
|
||||
window.state.physical_size();
|
||||
|
||||
current_compositor.configure_surface(
|
||||
&mut window.surface,
|
||||
physical_size.width,
|
||||
physical_size.height,
|
||||
);
|
||||
if error == compositor::SurfaceError::Lost {
|
||||
window.surface = current_compositor
|
||||
.create_surface(
|
||||
window.raw.clone(),
|
||||
physical_size.width,
|
||||
physical_size.height,
|
||||
);
|
||||
} else {
|
||||
current_compositor.configure_surface(
|
||||
&mut window.surface,
|
||||
physical_size.width,
|
||||
physical_size.height,
|
||||
);
|
||||
}
|
||||
|
||||
window.raw.request_redraw();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue