From ab39db55ba25c4c2f0d68eced1170443a3663fe9 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Thu, 15 Jul 2021 18:09:36 +0200 Subject: [PATCH] Completed switchgaps func --- src/dwm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dwm.c b/src/dwm.c index a480114..9db8e1c 100644 --- a/src/dwm.c +++ b/src/dwm.c @@ -315,6 +315,8 @@ static Window root, wmcheckwin; /* configuration, allows nested code to access above variables */ #include "config.h" +const unsigned int modeslen = (const unsigned int)(sizeof(modeslen) / sizeof(const unsigned int)); + #ifdef VERSION #include "IPCClient.c" #include "yajl_dumps.c" @@ -1854,9 +1856,10 @@ togglegaps(const Arg *arg) void switchgaps(const Arg *arg) { - const unsigned int modeslen = (const unsigned int)(sizeof(modeslen) / sizeof(const unsigned int)); - selmon->gapidx = (selmon->gapidx + arg->i) % modeslen; + + selmon->gappx = gapmodes[selmon->gapidx]; + arrange(selmon); } void