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 =
|
let physical_size =
|
||||||
window.state.physical_size();
|
window.state.physical_size();
|
||||||
|
|
||||||
current_compositor.configure_surface(
|
if error == compositor::SurfaceError::Lost {
|
||||||
&mut window.surface,
|
window.surface = current_compositor
|
||||||
physical_size.width,
|
.create_surface(
|
||||||
physical_size.height,
|
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();
|
window.raw.request_redraw();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue