placemouse: fix for crash when moving between monitors with different tags and there is no selected client on that monitor / tag

This is ref. https://github.com/bakkeby/patches/issues/27
This commit is contained in:
bakkeby 2021-04-14 17:16:05 +02:00
parent 6e80cb5f36
commit 4a45f23643

View File

@ -1,6 +1,6 @@
void void
moveorplace(const Arg *arg) { moveorplace(const Arg *arg) {
if ((!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating)) if ((!selmon->lt[selmon->sellt]->arrange || (selmon->sel && selmon->sel->isfloating)))
movemouse(arg); movemouse(arg);
else else
placemouse(arg); placemouse(arg);
@ -122,6 +122,7 @@ placemouse(const Arg *arg)
detachstack(c); detachstack(c);
arrangemon(c->mon); arrangemon(c->mon);
c->mon = m; c->mon = m;
c->tags = m->tagset[m->seltags];
attach(c); attach(c);
attachstack(c); attachstack(c);
selmon = m; selmon = m;