mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
baa398b324
Previously Cogl would only call wl_display_flush after doing a swap buffers on the onscreen because that is the only place where Cogl itself would end up queueing requests. However since commit 323fe188748 Cogl takes control of calling wl_display_dispatch as well which effectively makes it very difficult for the application to handle the Wayland event queue itself. Therefore it needs to rely on Cogl to do it which means that other parts of the application may also queue requests that need to be flushed. This patch tries to copy the display fd handling of window.c in the Weston example clients. wl_display_flush will always be called in prepare function for the fd which means it will always be called before going idle. If flushing the display causes the socket buffer to become full, it will additionally poll for write on the FD to try flushing again when it becomes empty. We also need to call wl_display_dispatch_pending in the prepare because apparently calling eglSwapBuffers can cause it to read data from the FD to receive events for a different queue. In that case there will be events that need to be handled but the FD will no longer be ready for reading so we won't wake up the main loop any other way. Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 962d1825105a87dd8358a765353b77f6af8fe760) |
||
---|---|---|
.. | ||
cogl-texture-pixmap-x11-private.h | ||
cogl-texture-pixmap-x11.c | ||
cogl-texture-pixmap-x11.h | ||
cogl-winsys-egl-android-private.h | ||
cogl-winsys-egl-android.c | ||
cogl-winsys-egl-feature-functions.h | ||
cogl-winsys-egl-gdl-private.h | ||
cogl-winsys-egl-gdl.c | ||
cogl-winsys-egl-kms-private.h | ||
cogl-winsys-egl-kms.c | ||
cogl-winsys-egl-null-private.h | ||
cogl-winsys-egl-null.c | ||
cogl-winsys-egl-private.h | ||
cogl-winsys-egl-wayland-private.h | ||
cogl-winsys-egl-wayland.c | ||
cogl-winsys-egl-x11-private.h | ||
cogl-winsys-egl-x11.c | ||
cogl-winsys-egl.c | ||
cogl-winsys-glx-feature-functions.h | ||
cogl-winsys-glx-private.h | ||
cogl-winsys-glx.c | ||
cogl-winsys-private.h | ||
cogl-winsys-sdl2.c | ||
cogl-winsys-sdl-private.h | ||
cogl-winsys-sdl.c | ||
cogl-winsys-stub-private.h | ||
cogl-winsys-stub.c | ||
cogl-winsys-wgl-feature-functions.h | ||
cogl-winsys-wgl-private.h | ||
cogl-winsys-wgl.c | ||
cogl-winsys.c |