[PATCH weston v1 09/17] tests: do attach only with normal surfaces

Marek Chalupa mchqwerty at gmail.com
Fri Dec 5 05:36:42 PST 2014


When we call move_client on toytoolkit client when intializing, then the
wl_buffer is NULL and we don't want that. Actually, toytoolkit clients
don't need attaching and commiting the surface at all, because it has
been already done.

Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
---
 tests/weston-test-client-helper.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c
index ea54c9e..abc41e9 100644
--- a/tests/weston-test-client-helper.c
+++ b/tests/weston-test-client-helper.c
@@ -91,18 +91,17 @@ move_client(struct client *client, int x, int y)
 	client->surface->y = y;
 	wl_test_move_surface(client->test->wl_test, surface->wl_surface,
 			     surface->x, surface->y);
-	/* The attach here is necessary because commit() will call congfigure
-	 * only on surfaces newly attached, and the one that sets the surface
-	 * position is the configure. */
-	wl_surface_attach(surface->wl_surface, surface->wl_buffer, 0, 0);
-	wl_surface_damage(surface->wl_surface, 0, 0, surface->width,
-			  surface->height);
-
-	frame_callback_set(surface->wl_surface, &done);
-
-	wl_surface_commit(surface->wl_surface);
-
-	frame_callback_wait(client, &done);
+	if (!client->toytoolkit) {
+		wl_surface_attach(surface->wl_surface, surface->wl_buffer, 0, 0);
+		wl_surface_damage(surface->wl_surface, 0, 0,
+				  surface->width, surface->height);
+
+		frame_callback_set(surface->wl_surface, &done);
+		wl_surface_commit(surface->wl_surface);
+		frame_callback_wait(client, &done);
+	} else {
+		client_roundtrip(client);
+	}
 }
 
 int
-- 
2.1.0



More information about the wayland-devel mailing list