return early if selmon is not part of the output layout in dirtomon()
instead of checking twice
This commit is contained in:
parent
0b2c33248c
commit
dbe44e48c8
8
dwl.c
8
dwl.c
|
@ -1168,12 +1168,12 @@ Monitor *
|
||||||
dirtomon(enum wlr_direction dir)
|
dirtomon(enum wlr_direction dir)
|
||||||
{
|
{
|
||||||
struct wlr_output *next;
|
struct wlr_output *next;
|
||||||
if (wlr_output_layout_get(output_layout, selmon->wlr_output)
|
if (!wlr_output_layout_get(output_layout, selmon->wlr_output))
|
||||||
&& (next = wlr_output_layout_adjacent_output(output_layout,
|
return selmon;
|
||||||
|
if ((next = wlr_output_layout_adjacent_output(output_layout,
|
||||||
dir, selmon->wlr_output, selmon->m.x, selmon->m.y)))
|
dir, selmon->wlr_output, selmon->m.x, selmon->m.y)))
|
||||||
return next->data;
|
return next->data;
|
||||||
if (wlr_output_layout_get(output_layout, selmon->wlr_output)
|
if ((next = wlr_output_layout_farthest_output(output_layout,
|
||||||
&& (next = wlr_output_layout_farthest_output(output_layout,
|
|
||||||
dir ^ (WLR_DIRECTION_LEFT|WLR_DIRECTION_RIGHT),
|
dir ^ (WLR_DIRECTION_LEFT|WLR_DIRECTION_RIGHT),
|
||||||
selmon->wlr_output, selmon->m.x, selmon->m.y)))
|
selmon->wlr_output, selmon->m.x, selmon->m.y)))
|
||||||
return next->data;
|
return next->data;
|
||||||
|
|
Loading…
Reference in a new issue