]> git.mdlowis.com Git - proto/labwc.git/commitdiff
action: Fix crash in move to edge
authorJoshua Ashton <joshua@froggi.es>
Sun, 17 Oct 2021 01:14:01 +0000 (01:14 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 17 Oct 2021 11:21:49 +0000 (12:21 +0100)
Fixes a crash in move to edge ( #77 ) when the centre of the window is out of any display regions.

Doesn't fix the expected behaviour that it would work, but much better than the whole compositor dying.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
src/view.c

index a35f5b2e81a4757b388daa5ed201a1823bd7dad3..011b69d614f55ff57cb99a59cc066ee2ca47ac28 100644 (file)
@@ -212,6 +212,10 @@ view_move_to_edge(struct view *view, const char *direction)
                return;
        }
        struct output *output = view_output(view);
+       if (!output) {
+               wlr_log(WLR_ERROR, "no output");
+               return; 
+       }       
        struct border border = view_border(view);
        struct wlr_box usable = output_usable_area_in_layout_coords(output);