return early if selmon is not part of the output layout in dirtomon()

instead of checking twice
このコミットが含まれているのは:
Leonardo Hernández Hernández 2022-12-30 14:31:56 -06:00
コミット dbe44e48c8
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: E538897EE11B9624
1個のファイルの変更4行の追加4行の削除

8
dwl.c
ファイルの表示

@ -1168,12 +1168,12 @@ Monitor *
dirtomon(enum wlr_direction dir)
{
struct wlr_output *next;
if (wlr_output_layout_get(output_layout, selmon->wlr_output)
&& (next = wlr_output_layout_adjacent_output(output_layout,
if (!wlr_output_layout_get(output_layout, selmon->wlr_output))
return selmon;
if ((next = wlr_output_layout_adjacent_output(output_layout,
dir, selmon->wlr_output, selmon->m.x, selmon->m.y)))
return next->data;
if (wlr_output_layout_get(output_layout, selmon->wlr_output)
&& (next = wlr_output_layout_farthest_output(output_layout,
if ((next = wlr_output_layout_farthest_output(output_layout,
dir ^ (WLR_DIRECTION_LEFT|WLR_DIRECTION_RIGHT),
selmon->wlr_output, selmon->m.x, selmon->m.y)))
return next->data;