2
0
mirror of https://github.com/bakkeby/patches synced 2024-11-13 07:10:31 +00:00
patches/dwm/dwm-togglelayout-6.3.diff
2022-01-10 14:53:38 +01:00

30 lines
903 B
Diff

From d1dd47c496e469f4c826ee884793d153f704a7ed Mon Sep 17 00:00:00 2001
From: Bakkeby <bakkeby@gmail.com>
Date: Mon, 10 Jan 2022 13:53:40 +0100
Subject: [PATCH] togglelayout - keyboard shortcuts to set a given layout will
toggle to the previous layout if the given layout is already active
---
dwm.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dwm.c b/dwm.c
index a96f33c..9006fef 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1504,9 +1504,8 @@ setfullscreen(Client *c, int fullscreen)
void
setlayout(const Arg *arg)
{
- if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
- selmon->sellt ^= 1;
- if (arg && arg->v)
+ selmon->sellt ^= 1;
+ if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1])
selmon->lt[selmon->sellt] = (Layout *)arg->v;
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
if (selmon->sel)
--
2.19.1