mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Updating sendmon_keepfocus to only keep focus if the client had focus
This commit is contained in:
parent
5a94b44e80
commit
5a4c350b9c
6
dwm.c
6
dwm.c
@ -2894,6 +2894,9 @@ sendmon(Client *c, Monitor *m)
|
|||||||
#endif // EXRESIZE_PATCH
|
#endif // EXRESIZE_PATCH
|
||||||
if (c->mon == m)
|
if (c->mon == m)
|
||||||
return;
|
return;
|
||||||
|
#if SENDMON_KEEPFOCUS_PATCH && !EXRESIZE_PATCH
|
||||||
|
int hadfocus = (c == selmon->sel);
|
||||||
|
#endif // SENDMON_KEEPFOCUS_PATCH
|
||||||
unfocus(c, 1);
|
unfocus(c, 1);
|
||||||
detach(c);
|
detach(c);
|
||||||
detachstack(c);
|
detachstack(c);
|
||||||
@ -2920,8 +2923,11 @@ sendmon(Client *c, Monitor *m)
|
|||||||
restack(m);
|
restack(m);
|
||||||
#elif SENDMON_KEEPFOCUS_PATCH
|
#elif SENDMON_KEEPFOCUS_PATCH
|
||||||
arrange(m);
|
arrange(m);
|
||||||
|
if (hadfocus) {
|
||||||
focus(c);
|
focus(c);
|
||||||
restack(m);
|
restack(m);
|
||||||
|
} else
|
||||||
|
focus(NULL);
|
||||||
#else
|
#else
|
||||||
focus(NULL);
|
focus(NULL);
|
||||||
arrange(NULL);
|
arrange(NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user