Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Commit

Permalink
fix crash in dirtomon() when selmon is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sevz17 committed Oct 29, 2022
1 parent a9e2eba commit 846ce52
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dwl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1152,10 +1152,12 @@ Monitor *
dirtomon(enum wlr_direction dir)
{
struct wlr_output *next;
if ((next = wlr_output_layout_adjacent_output(output_layout,
if (wlr_output_layout_get(output_layout, selmon->wlr_output)
&& (next = wlr_output_layout_adjacent_output(output_layout,
dir, selmon->wlr_output, selmon->m.x, selmon->m.y)))
return next->data;
if ((next = wlr_output_layout_farthest_output(output_layout,
if (wlr_output_layout_get(output_layout, selmon->wlr_output)
&& (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;
Expand Down

0 comments on commit 846ce52

Please sign in to comment.