mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-11-12 16:13:20 +00:00
fix a crash in focusmon() when no monitor is enabled
closemon() sets selmon to NULL when every output is disabled (e.g. turned off with wlr-randr), and dirtomon() dereferences it.
This commit is contained in:
@@ -1702,6 +1702,8 @@ void
|
|||||||
focusmon(const Arg *arg)
|
focusmon(const Arg *arg)
|
||||||
{
|
{
|
||||||
int i = 0, nmons = wl_list_length(&mons);
|
int i = 0, nmons = wl_list_length(&mons);
|
||||||
|
if (!selmon)
|
||||||
|
return;
|
||||||
if (nmons) {
|
if (nmons) {
|
||||||
do /* don't switch to disabled mons */
|
do /* don't switch to disabled mons */
|
||||||
selmon = dirtomon(arg->i);
|
selmon = dirtomon(arg->i);
|
||||||
|
|||||||
Reference in New Issue
Block a user