summaryrefslogtreecommitdiff
path: root/src/sxwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sxwm.c')
-rw-r--r--src/sxwm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sxwm.c b/src/sxwm.c
index f7ac401..f1fc94f 100644
--- a/src/sxwm.c
+++ b/src/sxwm.c
@@ -575,7 +575,9 @@ void focus_next_mon(void)
return;
}
- current_mon = focused->mon;
+ if (focused) {
+ current_mon = focused->mon;
+ }
int target_mon = (current_mon + 1) % n_mons;
/* find the first window on the target monitor in current workspace */
@@ -614,7 +616,9 @@ void focus_prev_mon(void)
return; /* only one monitor, nothing to switch to */
}
- current_mon = focused->mon;
+ if (focused) {
+ current_mon = focused->mon;
+ }
int target_mon = (current_mon - 1 + n_mons) % n_mons;
/* find the first window on the target monitor in current workspace */