ecore_wl2: Add API ecore_wl2_window_pending_get()

Lets us test if a commit has been requested but the compositor hasn't
yet told use to draw new content for it.
This commit is contained in:
Derek Foreman 2017-08-14 17:45:41 -05:00
parent 11d3bf7939
commit b599b1b900
2 changed files with 18 additions and 0 deletions

View File

@ -1891,6 +1891,17 @@ EAPI void ecore_wl2_session_recovery_disable(void);
EAPI void ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush);
/**
* Check if a wayland window's surface is in the pending state.
*
* A surface is pending if it's been commit but we haven't received a
* frame callback for it yet. This mean's we're not ready to draw yet.
*
* @return whether the window's surface is pending or not.
*
* @since 1.20
*/
EAPI Eina_Bool ecore_wl2_window_pending_get(Ecore_Wl2_Window *window);
# endif
# undef EAPI

View File

@ -1357,3 +1357,10 @@ EAPI void ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush)
if (flush) wl_surface_commit(window->surface);
}
EAPI Eina_Bool ecore_wl2_window_pending_get(Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
return window->commit_pending;
}