action: Fix crash in move to edge

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>
This commit is contained in:
Joshua Ashton 2021-10-17 01:14:01 +00:00 committed by Johan Malm
parent 8e3108c032
commit f12617deea

View 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);