fix: crash while resizing on x11
This commit is contained in:
parent
346faf2e79
commit
9ae155b8e2
1 changed files with 7 additions and 0 deletions
|
|
@ -368,6 +368,13 @@ pub fn present(
|
||||||
) -> Result<(), compositor::SurfaceError> {
|
) -> Result<(), compositor::SurfaceError> {
|
||||||
match surface.get_current_texture() {
|
match surface.get_current_texture() {
|
||||||
Ok(frame) => {
|
Ok(frame) => {
|
||||||
|
if frame.suboptimal
|
||||||
|
|| frame.texture.width() != viewport.physical_width()
|
||||||
|
|| frame.texture.height() != viewport.physical_height()
|
||||||
|
{
|
||||||
|
return Err(compositor::SurfaceError::Outdated);
|
||||||
|
}
|
||||||
|
|
||||||
let view = &frame
|
let view = &frame
|
||||||
.texture
|
.texture
|
||||||
.create_view(&wgpu::TextureViewDescriptor::default());
|
.create_view(&wgpu::TextureViewDescriptor::default());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue