[PATCH weston 3/6] libweston-desktop/xwayland: window type XWAYLAND cannot have a parent
Daniel Stone
daniel at fooishbar.org
Thu Nov 24 12:29:26 UTC 2016
Hi,
On 24 November 2016 at 11:40, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> Add an assert to ensure that a window of type XWAYLAND is never
> attempted with a parent.
>
> This essentially adding documentation.
>
> Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> ---
> libweston-desktop/xwayland.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/libweston-desktop/xwayland.c b/libweston-desktop/xwayland.c
> index bd68bc6..0c4ff2b 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 != XWAYLAND);
>From looking at the callers, it seems like it should be (!parent ||
state == TRANSIENT). I'm a huge fan of adding documentation via
asserts though!
Cheers,
Daniel
More information about the wayland-devel
mailing list