struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
+ /* Update the surface size as soon as native window is resized; from user
+ * pov, this makes the effect that resize is done inmediately after native
+ * window resize, without requiring to wait until the first draw.
+ *
+ * A more detailed and lengthy explanation can be found at
+ * https://lists.freedesktop.org/archives/mesa-dev/2018-June/196474.html
+ */
+ if (!dri2_surf->back) {
+ dri2_surf->base.Width = wl_win->width;
+ dri2_surf->base.Height = wl_win->height;
+ }
dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
}
struct dri2_egl_display *dri2_dpy =
dri2_egl_display(dri2_surf->base.Resource.Display);
- if (dri2_surf->base.Width != dri2_surf->wl_win->width ||
- dri2_surf->base.Height != dri2_surf->wl_win->height) {
+ if (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->back)
return 0;
- if (dri2_surf->base.Width != dri2_surf->wl_win->width ||
- dri2_surf->base.Height != dri2_surf->wl_win->height) {
+ if (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);