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:
		| @@ -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; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user