diff options
author | Arnaud Vrac <avrac@freebox.fr> | 2016-06-08 18:37:57 +0200 |
---|---|---|
committer | Daniel Stone <daniels@collabora.com> | 2016-11-22 12:39:11 +0000 |
commit | b8c16c995b02ca797a5ea7625756e6debe91220b (patch) | |
tree | 92ef7b695752910acc9347f4e5dd4884199dad5a /tests | |
parent | 11f8fcbefeb89336dba6ec4ea68d100212bd26e4 (diff) |
compositor: allow using nested parent as a subsurface sibling
The parent of a subsurface can be used as a sibling in the place_below
and place_above calls. However this did not work when the parent is
nested, so fix the sibling check and add a test to check this case.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/subsurface-test.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/subsurface-test.c b/tests/subsurface-test.c index 3ababdd3..03ff5392 100644 --- a/tests/subsurface-test.c +++ b/tests/subsurface-test.c @@ -250,6 +250,50 @@ TEST(test_subsurface_loop_paradox) WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE); } +TEST(test_subsurface_place_above_nested_parent) +{ + struct client *client; + struct compound_surface com; + struct wl_surface *grandchild; + struct wl_subcompositor *subco; + struct wl_subsurface *sub; + + client = create_client_and_test_surface(100, 50, 123, 77); + assert(client); + + populate_compound_surface(&com, client); + + subco = get_subcompositor(client); + grandchild = wl_compositor_create_surface(client->wl_compositor); + sub = wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]); + + wl_subsurface_place_above(sub, com.child[0]); + + client_roundtrip(client); +} + +TEST(test_subsurface_place_below_nested_parent) +{ + struct client *client; + struct compound_surface com; + struct wl_subcompositor *subco; + struct wl_surface *grandchild; + struct wl_subsurface *sub; + + client = create_client_and_test_surface(100, 50, 123, 77); + assert(client); + + populate_compound_surface(&com, client); + + subco = get_subcompositor(client); + grandchild = wl_compositor_create_surface(client->wl_compositor); + sub = wl_subcompositor_get_subsurface(subco, grandchild, com.child[0]); + + wl_subsurface_place_below(sub, com.child[0]); + + client_roundtrip(client); +} + TEST(test_subsurface_place_above_stranger) { struct client *client; |