commit c6efcce4646e5bea56c32f8f9b72abb71816ceb3
parent 8df112a6eef97a658fe86f7a178732cc1aefbe58
Author: Natasha Kerensikova <natacha@instinctive.eu>
Date: Fri, 3 May 2024 17:08:43 +0200
[nat] focus under mouse after swapmon and swapmonvisible
Diffstat:
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/dwm.c b/dwm.c
@@ -2086,6 +2086,7 @@ swapmon(const Arg *arg)
if (!mons->next)
return;
+ unfocus(selmon->sel, 1);
targetmon = dirtomon(arg->i);
tmp = *selmon;
@@ -2126,8 +2127,8 @@ swapmon(const Arg *arg)
c->mon = targetmon;
arrange(selmon);
- focus(targetmon->sel);
arrange(targetmon);
+ focus(getclientundermouse());
}
void
@@ -2136,7 +2137,6 @@ swapmonvisible(const Arg *arg)
Client **tc, *c;
Client *firstnew = NULL;
Client **dest;
- Client *selc = selmon->sel;
Monitor *targetmon;
unsigned int tagset = selmon->tagset[selmon->seltags];
@@ -2277,11 +2277,8 @@ swapmonvisible(const Arg *arg)
/* Refocus and rearrange */
arrange(NULL);
-
- if (selc && ISVISIBLE(selc)) {
- focus(selc);
- restack(selc->mon);
- }
+ focus(getclientundermouse());
+ // drawbars(); needed?
}
void