summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-06-24 17:12:54 +0200
committerbakkeby <[email protected]>2020-06-24 17:12:54 +0200
commit957403584953f510973db26e3e4ed1b3eb33a3f8 (patch)
tree44a1535bf253a5243741aee30716ec61cf8c00a1
parentce12e0716380011a9d052a9cd40241fed24b3157 (diff)
downloaddwm-flexipatch-957403584953f510973db26e3e4ed1b3eb33a3f8.tar.gz
dwm-flexipatch-957403584953f510973db26e3e4ed1b3eb33a3f8.zip
Adding sendmon_keepfocus patch
-rw-r--r--README.md5
-rw-r--r--dwm.c9
-rw-r--r--patches.def.h3
3 files changed, 15 insertions, 2 deletions
diff --git a/README.md b/README.md
index a1c0367..7db3452 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
-2020-06-24 - Added resizepoint and statusbutton patches
+2020-06-24 - Added resizepoint, statusbutton and sendmon_keepfocus patches
2020-06-21 - Added floatpos and bar_height patches
@@ -369,6 +369,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [selfrestart](https://dwm.suckless.org/patches/selfrestart/)
- restart dwm without the unnecessary dependency of an external script
+ - sendmon_keepfocus
+ - minor patch that allow clients to keep focus when being sent to another monitor
+
- [setborderpx](https://dwm.suckless.org/patches/statuspadding/)
- this patch allows border pixels to be changed during runtime
diff --git a/dwm.c b/dwm.c
index c41ba93..a60de73 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2897,6 +2897,9 @@ sendmon(Client *c, Monitor *m)
unfocus(c, 1);
detach(c);
detachstack(c);
+ #if SENDMON_KEEPFOCUS_PATCH && !EXRESIZE_PATCH
+ arrange(c->mon);
+ #endif // SENDMON_KEEPFOCUS_PATCH
c->mon = m;
#if EMPTYVIEW_PATCH
c->tags = (m->tagset[m->seltags] ? m->tagset[m->seltags] : 1);
@@ -2915,10 +2918,14 @@ sendmon(Client *c, Monitor *m)
arrange(m);
focus(c);
restack(m);
+ #elif SENDMON_KEEPFOCUS_PATCH
+ arrange(m);
+ focus(c);
+ restack(m);
#else
focus(NULL);
arrange(NULL);
- #endif // EXRESIZE_PATCH
+ #endif // EXRESIZE_PATCH / SENDMON_KEEPFOCUS_PATCH
#if SWITCHTAG_PATCH
if (c->switchtag)
c->switchtag = 0;
diff --git a/patches.def.h b/patches.def.h
index 2a54939..97eb0c7 100644
--- a/patches.def.h
+++ b/patches.def.h
@@ -507,6 +507,9 @@
*/
#define SELFRESTART_PATCH 0
+/* This patch allow clients to keep focus when being sent to another monitor. */
+#define SENDMON_KEEPFOCUS_PATCH 0
+
/* This patch allows border pixels to be changed during runtime.
* https://dwm.suckless.org/patches/setborderpx/
*/