From b9ce5c68834a2af1645333b274b90126f6f24128 Mon Sep 17 00:00:00 2001 From: uint23 Date: Tue, 29 Apr 2025 18:54:48 +0100 Subject: added guards to focus_next & pev to make sure no segfault on trying to swithc focus on them --- src/sxwm.c | 6 +++--- 1 file 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 -- cgit v1.2.3