~ruther/dwl

a14d6da36f1a77cd73daf751828224dd407e78f9 — wochap 1 year, 1 month ago 0b3d707
fix: edge case where there are more than 1 window with the same scratchkey
1 files changed, 10 insertions(+), 1 deletions(-)

M dwl.c
M dwl.c => dwl.c +10 -1
@@ 2534,18 2534,26 @@ focusortogglematchingscratch(const Arg *arg)
{
	Client *c;
	unsigned int found = 0;
	unsigned int hide = 0;

	wl_list_for_each(c, &clients, link) {
		if (c->scratchkey == 0) {
			continue;
		}
		if (c->scratchkey == ((char**)arg->v)[0][0]) {
			found = 1;
			if (VISIBLEON(c, selmon)) {
				if (found == 1) {
					if (hide == 1) {
						c->tags = 0;
						focusclient(focustop(selmon), 1);
					}
					continue;
				}
				if (focustop(selmon) == c) {
					// hide
					c->tags = 0;
					focusclient(focustop(selmon), 1);
					hide = 1;
				} else {
					// focus
					focusclient(c, 1);


@@ 2556,6 2564,7 @@ focusortogglematchingscratch(const Arg *arg)
				// focus
				focusclient(c, 1);
			}
			found = 1;
			continue;
		}
		if (VISIBLEON(c, selmon)) {

Do not follow this link