On 24/11/2016 12:40, Pekka Paalanen wrote:
From: Pekka Paalanen <[email protected]>

Add documentation (asserts) that show that windows of types XWAYLAND are
never registered with the shell.

Signed-off-by: Pekka Paalanen <[email protected]>

Not a big fan of asserts in internal stuff, but if you feel like it’s needed:
Reviewed-by: Quentin Glidic <[email protected]>

Cheers,

---
 libweston-desktop/xwayland.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libweston-desktop/xwayland.c b/libweston-desktop/xwayland.c
index f0cd1ed..7b8f6db 100644
--- a/libweston-desktop/xwayland.c
+++ b/libweston-desktop/xwayland.c
@@ -83,6 +83,8 @@ weston_desktop_xwayland_surface_change_state(struct 
weston_desktop_xwayland_surf

        if (surface->state != state) {
                if (surface->state == XWAYLAND) {
+                       assert(!surface->added);
+
                        weston_desktop_surface_unlink_view(surface->view);
                        weston_view_destroy(surface->view);
                        surface->view = NULL;
@@ -100,6 +102,8 @@ weston_desktop_xwayland_surface_change_state(struct 
weston_desktop_xwayland_surf
                }

                if (state == XWAYLAND) {
+                       assert(!surface->added);
+
                        surface->view =
                                
weston_desktop_surface_create_view(surface->surface);
                        
weston_layer_entry_insert(&surface->xwayland->layer.view_list,



--

Quentin “Sardem FF7” Glidic
_______________________________________________
wayland-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to