From 5b14a094e7a2184b17d11d197ef87c03c1798890 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 28 Jun 2023 17:22:14 +0100 Subject: [PATCH] tests: Use weston_view_move_to_layer() Use the helper, don't mark stuff as mapped ourselves. Set the position before the view, so when it's marked as mapped, it's already in position. Signed-off-by: Daniel Stone --- tests/weston-test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/weston-test.c b/tests/weston-test.c index 7744ad857..76f8cc1ed 100644 --- a/tests/weston-test.c +++ b/tests/weston-test.c @@ -261,14 +261,14 @@ test_surface_committed(struct weston_surface *surface, weston_surface_map(test_surface->surface); - if (wl_list_empty(&test_surface->view->layer_link.link)) - weston_layer_entry_insert(&test->layer.view_list, - &test_surface->view->layer_link); - test_surface->view->is_mapped = true; - pos.c = weston_coord(test_surface->x, test_surface->y); weston_view_set_position(test_surface->view, pos); + if (wl_list_empty(&test_surface->view->layer_link.link)) { + weston_view_move_to_layer(test_surface->view, + &test->layer.view_list); + } + weston_view_update_transform(test_surface->view); }