summaryrefslogtreecommitdiff
path: root/libweston-desktop
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-11-15 11:43:36 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-11-25 13:12:21 +0200
commita838b7825fa780333f4c9ca0cb61707a9df39748 (patch)
treeec9f9e8e665de2abe048949a5fa480a1e30297cf /libweston-desktop
parent44660c3b9c9ed277d87d4a982edacc0b2e9b7939 (diff)
libweston-desktop/xwayland: window type XWAYLAND cannot have a parent
Add an assert to ensure that a window of type XWAYLAND is never attempted with a parent. Following the code though, the assert can be made even stricter by allowing only TRANSIENT to have a parent. This is essentially adding documentation. v2: use stricter assert Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'libweston-desktop')
-rw-r--r--libweston-desktop/xwayland.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libweston-desktop/xwayland.c b/libweston-desktop/xwayland.c
index bd68bc68..62a33899 100644
--- a/libweston-desktop/xwayland.c
+++ b/libweston-desktop/xwayland.c
@@ -74,6 +74,7 @@ weston_desktop_xwayland_surface_change_state(struct weston_desktop_xwayland_surf
bool to_add = (parent == NULL && state != XWAYLAND);
assert(state != NONE);
+ assert(!parent || state == TRANSIENT);
if (to_add && surface->added) {
surface->state = state;