From 51eb6acc7af0c288896dc1a10d7577cfd8459bc8 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 26 Feb 2018 15:33:21 +0900 Subject: [PATCH] display: add tdm_display_flush Change-Id: I8fd5bf404cac29d323a858bec482e45754d7ef9d --- include/tdm.h | 7 +++++++ src/tdm_display.c | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/include/tdm.h b/include/tdm.h index 9ae31a3..09a0f7b 100644 --- a/include/tdm.h +++ b/include/tdm.h @@ -96,6 +96,13 @@ tdm_error tdm_display_handle_events(tdm_display *dpy); /** + * @brief Flush the all events to clients + * @param[in] dpy A display object + */ +void +tdm_display_flush(tdm_display *dpy); + +/** * @brief Get the capabilities of a display object. * @details A frontend user can get whether TDM supports pp/capture functionality with this function. * @param[in] dpy A display object diff --git a/src/tdm_display.c b/src/tdm_display.c index a7e880e..d2fba50 100644 --- a/src/tdm_display.c +++ b/src/tdm_display.c @@ -405,6 +405,20 @@ tdm_display_handle_events(tdm_display *dpy) return ret; } +EXTERN void +tdm_display_flush(tdm_display *dpy) +{ + tdm_private_display *private_display; + + TDM_RETURN_IF_FAIL(dpy != NULL); + private_display = (tdm_private_display*)dpy; + + if (tdm_thread_is_running()) + return; + + tdm_event_loop_flush(private_display); +} + EXTERN tdm_error tdm_display_get_backend_info(tdm_display *dpy, const char **name, const char **vendor, int *major, int *minor) -- 2.7.4