summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruint23 <[email protected]>2025-04-29 18:54:48 +0100
committeruint23 <[email protected]>2025-04-29 18:54:48 +0100
commitb9ce5c68834a2af1645333b274b90126f6f24128 (patch)
tree621f016d0b628e6dc7711ae6a607dc1aecd8141a
parent61c1e16a841cc7b7bc72b727052eadf346a63c4e (diff)
added guards to focus_next & pev to make sure no segfault on trying to swithc focus on them
-rw-r--r--src/sxwm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sxwm.c b/src/sxwm.c
index 660c74e..a309548 100644
--- a/src/sxwm.c
+++ b/src/sxwm.c
@@ -226,7 +226,7 @@ void dec_gaps(void)
void focus_next(void)
{
- if (!focused) {
+ if (!focused || !workspaces[current_ws]) {
return;
}
@@ -238,7 +238,7 @@ void focus_next(void)
void focus_prev(void)
{
- if (!focused) {
+ if (!focused || !workspaces[current_ws]) {
return;
}
@@ -1491,4 +1491,4 @@ int main(int ac, char **av)
setup();
run();
return 0;
-}
+} \ No newline at end of file