From f6bd73167a0273bba8f11ba335d54be15d4df173 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 5 Oct 2017 14:06:42 -0500 Subject: [PATCH] ecore_wl2: Add as partial commit function for setting off a tick This adds the concept of a "false commit" that just sends a surface commit without changing any other state. This is intended to be used by ecore_evas to request a frame callback from the compositor --- src/lib/ecore_wl2/Ecore_Wl2.h | 2 ++ src/lib/ecore_wl2/ecore_wl2_window.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 70edf4d..1b15e29 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -1892,6 +1892,8 @@ EAPI void ecore_wl2_session_recovery_disable(void); */ EAPI void ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush); +EAPI void ecore_wl2_window_false_commit(Ecore_Wl2_Window *window); + /** * Check if a wayland window's surface is in the pending state. * diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index 9b22319..ebb7918 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -1411,6 +1411,22 @@ ecore_wl2_window_commit(Ecore_Wl2_Window *window, Eina_Bool flush) window->updating = EINA_FALSE; } +EAPI void ecore_wl2_window_false_commit(Ecore_Wl2_Window *window) +{ + EINA_SAFETY_ON_NULL_RETURN(window); + EINA_SAFETY_ON_NULL_RETURN(window->surface); + EINA_SAFETY_ON_TRUE_RETURN(window->pending.configure); + + if (window->commit_pending) + ERR("Commit before previous commit processed"); + + window->callback = wl_surface_frame(window->surface); + wl_callback_add_listener(window->callback, &_frame_listener, window); + wl_surface_commit(window->surface); + ecore_wl2_display_flush(window->display); + window->commit_pending = EINA_TRUE; +} + EAPI Eina_Bool ecore_wl2_window_pending_get(Ecore_Wl2_Window *window) { -- 2.7.4