]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: backport null check from wlroots-0.17 branch
authorJohn Lindgren <john@jlindgren.net>
Sat, 14 Oct 2023 17:56:03 +0000 (13:56 -0400)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Sat, 14 Oct 2023 18:01:51 +0000 (20:01 +0200)
Check that wlr_layer_surface_v1_from_wlr_surface() doesn't return NULL.
This may be unnecessary with wlroots 0.16 (not sure) but doesn't hurt
and reduces the delta to the wlroots-0.17 branch.

src/cursor.c

index f100a9c99349f3153a2796c07fdadb9b289e8fd1..de6d0db071f3041817a17aec2280265cdd179abd 100644 (file)
@@ -910,7 +910,7 @@ cursor_button_press(struct seat *seat, struct wlr_pointer_button_event *event)
        if (ctx.type == LAB_SSD_LAYER_SURFACE) {
                struct wlr_layer_surface_v1 *layer =
                        wlr_layer_surface_v1_from_wlr_surface(ctx.surface);
-               if (layer->current.keyboard_interactive) {
+               if (layer && layer->current.keyboard_interactive) {
                        seat_set_focus_layer(seat, layer);
                }
        }