Allowing engines to explicitly flush at the right times will remove some
awkwardness and bugs from our current display flush paradigm
*/
EAPI void ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, void *buffer, int x, int y, Eina_Bool implicit);
+/**
+ * Push buffered wayland protocol to compositor
+ *
+ * Wayland protocol is only actually sent when a flush occurs,
+ * so the display should be flushed at appropriate times, such
+ * as after a commit.
+ *
+ * @param display
+ * @since 1.20
+ */
+EAPI void ecore_wl2_display_flush(Ecore_Wl2_Display *display);
+
# endif
# undef EAPI
EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
return display->name;
}
+
+EAPI void
+ecore_wl2_display_flush(Ecore_Wl2_Display *display)
+{
+ int ret, code;
+
+ EINA_SAFETY_ON_NULL_RETURN(display);
+
+ ret = wl_display_flush(display->wl.display);
+ if (ret >= 0) return;
+
+ code = errno;
+ if (code == EAGAIN)
+ {
+ ecore_main_fd_handler_active_set(display->fd_hdl,
+ (ECORE_FD_READ | ECORE_FD_WRITE));
+ return;
+ }
+
+ _begin_recovery_maybe(display, code);
+}