Sample code to demonstrate the issue to stack wayland sub surfaces. It's borrowed from https://lists.freedesktop.org/archives/wayland-devel/2015-June/022707.html.
Test environment:
- Fedora 25
- Gnome 3.22.2
- wayland-devel-1.12.0-1
- libwayland-client-1.12.0-1
Build and run:
$ make
$ ./test