]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: remove obsolete (since wlroots 0.17) NULL check
authorJohn Lindgren <john@jlindgren.net>
Tue, 11 Nov 2025 21:45:28 +0000 (16:45 -0500)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Sat, 15 Nov 2025 11:19:31 +0000 (12:19 +0100)
Since d7dc6e01b446 ("Chase wlroots: Unified mapping"), the map event
is emitted by the wlr_surface itself, thus it cannot be NULL.

Change the "if" to an "assert" accordingly.

src/xwayland.c

index 47b6d12f806cd8c026c1bd401430ea7c5f256d05..1dda710b237d090b19a74b16a8d14aa23691ef8e 100644 (file)
@@ -799,20 +799,11 @@ xwayland_view_map(struct view *view)
        struct wlr_xwayland_surface *xwayland_surface =
                xwayland_view->xwayland_surface;
        assert(xwayland_surface);
+       assert(xwayland_surface->surface);
 
        if (view->mapped) {
                return;
        }
-       if (!xwayland_surface->surface) {
-               /*
-                * We may get here if a user minimizes an xwayland dialog at the
-                * same time as the client requests unmap, which xwayland
-                * clients sometimes do without actually requesting destroy
-                * even if they don't intend to use that view/surface anymore
-                */
-               wlr_log(WLR_DEBUG, "Cannot map view without wlr_surface");
-               return;
-       }
 
        /*
         * The map_request event may not be received when an unmanaged