~ruther/dwl

0a7506ee8cb09b476ade132796d08464701d4cc3 — Rutherther 11 months ago 09e40c1 + f01a3ac
Merge branch 'patch/singletagset-pertag' into v0.6-a/patched-base
1 files changed, 13 insertions(+), 7 deletions(-)

M dwl.c
M dwl.c => dwl.c +13 -7
@@ 3727,25 3727,29 @@ view(const Arg *arg)
	Monitor *m, *origm = selmon;
	unsigned int newtags;

	if (!selmon || (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
	if (!selmon || (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) {
		return;
	}

	newtags = selmon->tagset[selmon->seltags ^ 1];
	newtags = origm->tagset[origm->seltags ^ 1];

	/* swap tags when trying to display a tag from another monitor */
	if (arg->ui & TAGMASK)
	if (arg->ui & TAGMASK) {
		newtags = arg->ui & TAGMASK;
	}
	wl_list_for_each(m, &mons, link) {
		if (m != selmon && newtags & m->tagset[m->seltags]) {
		if (m != origm && newtags & m->tagset[m->seltags]) {
			/* prevent displaying all tags (MODKEY-0) when multiple monitors
			 * are connected */
			if (newtags & selmon->tagset[selmon->seltags])
			if (newtags & origm->tagset[origm->seltags]) {
				return;
			}
			m->seltags ^= 1;
			m->tagset[m->seltags] = selmon->tagset[selmon->seltags];
			m->pertag[m->seltags] = selmon->pertag[selmon->seltags];
			m->tagset[m->seltags] = origm->tagset[origm->seltags];
			m->pertag[m->seltags] = origm->pertag[origm->seltags];
			applypertag(m);
			attachclients(m);
			/* Beware: this changes selmon */
			focusclient(focustop(m), 1);
			arrange(m);
			break;


@@ 3758,6 3762,8 @@ view(const Arg *arg)
		origm->pertag[origm->seltags] = getpertagtag(arg->ui & TAGMASK);
	}

	/* Change selmon back to orig mon */
	selmon = origm;
	applypertag(origm);
	attachclients(origm);
	focusclient(focustop(origm), 1);

Do not follow this link