odrling-overlay/x11-wm/dwm/files/0018-sendmon-keeptag-patch.patch

47 lines
1.3 KiB
Diff

From 18a1239defc4dbfad324582ef9040c2aa918bb86 Mon Sep 17 00:00:00 2001
From: odrling <florianbadie@odrling.xyz>
Date: Wed, 20 Apr 2022 19:13:43 +0200
Subject: [PATCH 18/26] sendmon: keeptag patch
---
dwm.c | 2 ++
patches.def.h | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/dwm.c b/dwm.c
index 9f70675..fa00ebb 100644
--- a/dwm.c
+++ b/dwm.c
@@ -3198,11 +3198,13 @@ sendmon(Client *c, Monitor *m)
#if SCRATCHPADS_PATCH
if (!(c->tags & SPTAGMASK))
#endif // SCRATCHPADS_PATCH
+ #if !SENDMON_KEEPTAGS
#if EMPTYVIEW_PATCH
c->tags = (m->tagset[m->seltags] ? m->tagset[m->seltags] : 1);
#else
c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
#endif // EMPTYVIEW_PATCH
+ #endif // SENDMON_KEEPTAGS
#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH
attachx(c);
#else
diff --git a/patches.def.h b/patches.def.h
index 8dd9b72..2517801 100644
--- a/patches.def.h
+++ b/patches.def.h
@@ -939,6 +939,10 @@
*/
#define SENDMON_KEEPFOCUS_PATCH 0
+/* This patch allow clients to keep their current tags when sent to another monitor
+ */
+#define SENDMON_KEEPTAGS 1
+
/* This patch allows border pixels to be changed during runtime.
* https://dwm.suckless.org/patches/setborderpx/
*/
--
2.35.1