[PATCH weston 5/6] toytoolkit: implement a window_present() helper function

Manuel Bachmann manuel.bachmann at open.eurogiciel.org
Thu Apr 9 09:24:46 PDT 2015


"window_present()" is a little helper function calling
"xdg_surface_present()" on a toytoolkit shell surface.

Signed-off-by: Manuel Bachmann <manuel.bachmann at open.eurogiciel.org>
---
 clients/window.c | 9 +++++++++
 clients/window.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/clients/window.c b/clients/window.c
index 81e007b..cfa0451 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -4337,6 +4337,15 @@ window_set_minimized(struct window *window)
 }
 
 void
+window_present(struct window *window)
+{
+	if (!window->xdg_surface)
+		return;
+
+	xdg_surface_present(window->xdg_surface);
+}
+
+void
 window_set_user_data(struct window *window, void *data)
 {
 	window->user_data = data;
diff --git a/clients/window.h b/clients/window.h
index 0686c3f..b2d6f9c 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -395,6 +395,9 @@ void
 window_set_minimized(struct window *window);
 
 void
+window_present(struct window *window);
+
+void
 window_set_user_data(struct window *window, void *data);
 
 void *
-- 
1.8.3.1



More information about the wayland-devel mailing list