summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-06-25 10:28:31 +0200
committerbakkeby <[email protected]>2020-06-25 10:28:31 +0200
commit5a4c350b9cdbee170c60354643d33541d469fe2b (patch)
tree1f9da40264ac874ded6dd7c558757ede0fe8ff35
parent5a94b44e8034113ccec6c3fd31559db336a5091c (diff)
downloaddwm-flexipatch-5a4c350b9cdbee170c60354643d33541d469fe2b.tar.gz
dwm-flexipatch-5a4c350b9cdbee170c60354643d33541d469fe2b.zip
Updating sendmon_keepfocus to only keep focus if the client had focus
-rw-r--r--dwm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index a60de73..9939a8b 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2894,6 +2894,9 @@ sendmon(Client *c, Monitor *m)
#endif // EXRESIZE_PATCH
if (c->mon == m)
return;
+ #if SENDMON_KEEPFOCUS_PATCH && !EXRESIZE_PATCH
+ int hadfocus = (c == selmon->sel);
+ #endif // SENDMON_KEEPFOCUS_PATCH
unfocus(c, 1);
detach(c);
detachstack(c);
@@ -2920,8 +2923,11 @@ sendmon(Client *c, Monitor *m)
restack(m);
#elif SENDMON_KEEPFOCUS_PATCH
arrange(m);
- focus(c);
- restack(m);
+ if (hadfocus) {
+ focus(c);
+ restack(m);
+ } else
+ focus(NULL);
#else
focus(NULL);
arrange(NULL);