diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 98fdc1e2e2d..9acc846687b 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -302,6 +302,7 @@ struct dri2_egl_surface struct wl_drm *wl_drm_wrapper; struct wl_callback *throttle_callback; int format; + bool resized; #endif #ifdef HAVE_DRM_PLATFORM diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index e37579995e5..e1f445e1de3 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -279,6 +279,8 @@ resize_callback(struct wl_egl_window *wl_win, void *data) dri2_surf->base.Height == wl_win->height) return; + dri2_surf->resized = true; + /* Update the surface size as soon as native window is resized; from user * pov, this makes the effect that resize is done immediately after native * window resize, without requiring to wait until the first draw. @@ -714,10 +716,9 @@ update_buffers(struct dri2_egl_surface *dri2_surf) dri2_surf->dy = dri2_surf->wl_win->dy; } - if (dri2_surf->wl_win && - (dri2_surf->base.Width != dri2_surf->wl_win->attached_width || - dri2_surf->base.Height != dri2_surf->wl_win->attached_height)) { - dri2_wl_release_buffers(dri2_surf); + if (dri2_surf->resized) { + dri2_wl_release_buffers(dri2_surf); + dri2_surf->resized = false; } if (get_back_bo(dri2_surf) < 0) {