From 4d8f6af4873c67160afdab8bd3d85da8831e1807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 25 Mar 2024 13:07:10 +0100 Subject: [PATCH] test/wayland/client-utils: Add 'painted' signal This is emitted when a client painted and committed new surface content. Part-of: --- .../wayland-test-client-utils.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/tests/wayland-test-clients/wayland-test-client-utils.c b/src/tests/wayland-test-clients/wayland-test-client-utils.c index af47a420e..fc205587e 100644 --- a/src/tests/wayland-test-clients/wayland-test-client-utils.c +++ b/src/tests/wayland-test-clients/wayland-test-client-utils.c @@ -38,6 +38,7 @@ enum { SYNC_EVENT, + SURFACE_PAINTED, N_SIGNALS }; @@ -453,6 +454,16 @@ wayland_display_class_init (WaylandDisplayClass *klass) G_TYPE_NONE, 1, G_TYPE_UINT); + + signals[SURFACE_PAINTED] = + g_signal_new ("surface-painted", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, NULL, + G_TYPE_NONE, + 1, + WAYLAND_TYPE_SURFACE); } static void @@ -529,6 +540,8 @@ handle_xdg_surface_configure (void *data, xdg_surface_ack_configure (xdg_surface, serial); wl_surface_commit (surface->wl_surface); + + g_signal_emit (surface->display, signals[SURFACE_PAINTED], 0, surface); } static const struct xdg_surface_listener xdg_surface_listener = {