wayland: Flush before blocking in swapbuffers.
authorJørgen Lind <jorgen.lind@nokia.com>
Thu, 15 Sep 2011 15:36:46 +0000 (17:36 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 15 Sep 2011 15:53:39 +0000 (11:53 -0400)
Make sure that we've sent the frame request that we're going to block on.

src/egl/drivers/dri2/platform_wayland.c

index ff641ee2b2758b05072373f32609a371c5adb6e7..7a70d8d59053a1b0c30a8e08b728fc222f9943b1 100644 (file)
@@ -574,8 +574,11 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
    struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
    struct wl_callback *callback;
 
-   while (dri2_surf->block_swap_buffers)
-      wl_display_iterate(dri2_dpy->wl_dpy, WL_DISPLAY_READABLE);
+   if (dri2_surf->block_swap_buffers) {
+      wl_display_flush(dri2_dpy->wl_dpy);
+      while (dri2_surf->block_swap_buffers)
+         wl_display_iterate(dri2_dpy->wl_dpy, WL_DISPLAY_READABLE);
+   }
 
    dri2_surf->block_swap_buffers = EGL_TRUE;
    callback = wl_surface_frame(dri2_surf->wl_win->surface);