diff options
| author | Abhinav Prasai <abhinav.prsai@gmail.com> | 2025-08-25 16:18:34 +0100 |
|---|---|---|
| committer | Abhinav Prasai <abhinav.prsai@gmail.com> | 2025-08-28 09:54:09 +0100 |
| commit | 79843b730b50672311a7191ab69cc305bfab339c (patch) | |
| tree | d11f1474212bb04a28c2199fffceca49ac419a76 /src | |
| parent | 3e650ef606b6271bab500dd42498e0ad86820e54 (diff) | |
add focused checking to prevent crash and make clangd option
Diffstat (limited to 'src')
| -rw-r--r-- | src/sxwm.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 */ |
