summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 772116a1925..7b90387a68f 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -97,6 +97,16 @@ static struct wl_buffer_listener wl_buffer_listener = {
wl_buffer_release
};
+static void
+resize_callback(struct wl_egl_window *wl_win, void *data)
+{
+ struct dri2_egl_surface *dri2_surf = data;
+ struct dri2_egl_display *dri2_dpy =
+ dri2_egl_display(dri2_surf->base.Resource.Display);
+
+ (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
+}
+
/**
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
*/
@@ -142,6 +152,9 @@ dri2_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
case EGL_WINDOW_BIT:
dri2_surf->wl_win = (struct wl_egl_window *) window;
+ dri2_surf->wl_win->private = dri2_surf;
+ dri2_surf->wl_win->resize_callback = resize_callback;
+
dri2_surf->base.Width = -1;
dri2_surf->base.Height = -1;
break;
@@ -216,6 +229,12 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
if (dri2_surf->frame_callback)
wl_callback_destroy(dri2_surf->frame_callback);
+
+ if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
+ dri2_surf->wl_win->private = NULL;
+ dri2_surf->wl_win->resize_callback = NULL;
+ }
+
free(surf);
return EGL_TRUE;
@@ -587,7 +606,6 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
}
(*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
- (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
return EGL_TRUE;
}