bakkeby/patches

[bug] netactiverules - rule 2 focuses only client tag or client tag with the first tag

luravoid opened this issue · 4 comments

When receiving a net active signal for programs with rule 2, only the client tag or client tag with the first tag gets focused, regardless of which tag I get the signal on. I tested this without any additional patches on clean dwm 6.4

I am not entirely sure what you mean.

Are you referring specifically to receiving clients that are assigned to more than one tag?

Do you mean something like this perhaps?

  • client A is on tag 3, 5 and 7
  • the view is on tag 7 and focus rests on client B
  • a _NET_ACTIVE_WINDOW client message is received for client A
  • the result is that tag 3 is enabled in addition to tag 7 despite the client already being visible on the current view (tag 7)

Let's say I'm on tag 3, and I have program "obsidian" on tag 5. When I use xdotool search --name "obsidian" windowactivate it always toggles tag 1 and tag 5 instead of toggling tag 3 and tag 5
image

+ case FocusPlus:
+ // Similar to the original focusonnetactive
+ // logic, but shows the client's tag in
+ // addition to your current tags.
+ for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++);
+ if (i < LENGTH(tags)) {
+ selmon = c->mon;
+ view(&((Arg) {.ui = c->mon->seltags | (1 << i)}));
+ focus(c);
+ restack(selmon);
+ }
+ break;

I see, in the line view(&((Arg) {.ui = c->mon->seltags | (1 << i)})); we are passing c->mon->seltags which is either 0 or 1.
It should have said c->mon->tagset[c->mon->seltags].

Works perfect. Thank you