A side effect of eglSwapBuffers* is the EGL implementation calling
wl_surface_commit() on the corresponding Wayland surface. Thus, before
swapping buffers, we must synchronize the surface state (e.g. opaque
region, window geometry, etc) that changed since the last buffer swap.
Prior to this commit, this was done after eglSwapBuffers*, causing the
surface state to always correspond to the previous buffer state. As of
this commit this is now done before swapping the buffers, thus before
wl_surface_commit().
egl_surface = gdk_wayland_surface_get_egl_surface (surface->impl_surface,
context_wayland->egl_config);
+ gdk_wayland_surface_sync (surface);
+
if (display_wayland->have_egl_swap_buffers_with_damage && damage != NULL)
{
int i, j, n_rects = cairo_region_num_rectangles (damage);
}
else
eglSwapBuffers (display_wayland->egl_display, egl_surface);
-
- gdk_wayland_surface_sync (surface);
}
static void