bakkeby / dwm-flexipatch

A dwm build with preprocessor directives to decide which patches to include during build time
MIT License
1.15k stars 235 forks source link

Patch Request: focusmaster-return #398

Closed Ampnbsp closed 4 months ago

Ampnbsp commented 10 months ago

https://dwm.suckless.org/patches/focusmaster/ If is wouldn't be added, is it possible to change the original focusmaster patch? This patch is very useful for example in deck layout when I need work only with two widows and don't place others windows in other tag because move focus with many opened windows is very painful.

bakkeby commented 10 months ago

So if I understand it correctly the focusmaster-return combines the focusmaster patch with one of the ideas from the mark patch. It also keeps a reference to the previous file similar to the zoomswap patch. One could also draw parallels to the swapfocus patch.

All in all it seems feasible to include this, just a minor conflict with the zoomswap patch as that doesn't use the pop() function.

I don't place others windows in other tag because move focus with many opened windows is very painful

How come? Maybe there are solutions that may alleviate some of that suffering.

The stacker patch can be very handy in a keyboard driven setup as you can focus directly on the nth client in the stack; also when using the deck layout as in your example.

Ampnbsp commented 10 months ago

If I get it right the stacker patch is too overkill for me and this needs for more than one keybind to swap with only the master window. It's easier to use the focusmaster with the swapfocus patches.

So I'll try to include the focusmaster-return patch or include the mark patch and make it automark the master window. I'll close the issue when I'm done.

bakkeby commented 10 months ago

I added that patch variant. Didn't have time to test it properly so let me know if you find any issues.

Technically I wonder why the clients are stored in the tagmarked array to have a reference to the previously focused client, as opposed to just traversing m->stack. I suppose that it may give some consistency in terms of focus change specifically when you use that keybinding, i.e. focus change using say focusstack or by moving the mouse wouldn't interfere.

You are right in that the stacker patch takes up an awful lot of keys for the keybindings. It is a compromise of course.

Ampnbsp commented 10 months ago

Patch works just fine. One more thing I added is restack after this contidion.

bakkeby commented 10 months ago

Why the restack? Is it to update the bar or were you experiencing any issues with overlapping windows?

Ampnbsp commented 10 months ago

When I work in deck layout there may be a situation when returning focus from master window appearing overlapping issue.

https://github.com/bakkeby/dwm-flexipatch/assets/41110719/6ba93454-71ac-4bda-a12d-f4752aa6dcf6

bakkeby commented 10 months ago

Thanks for confirming.