Adding tagintostack patch

This commit is contained in:
bakkeby 2019-10-05 00:12:52 +02:00
parent a25d00eb00
commit a8049d86bb
3 changed files with 53 additions and 1 deletions

View File

@ -13,7 +13,7 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
2019-10-04 - Added maximize, movestack, monoclesymbol, noborder and tagall patches
2019-10-04 - Added maximize, movestack, monoclesymbol, noborder, tagall and tagintostack patches
2019-10-03 - Added onlyquitonempty and switchcol patches
@ -203,6 +203,10 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- [tagallmon](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagallmon-6.2.diff)
- move all visible windows to an adjacent monitor
- [tagintostack](https://dwm.suckless.org/patches/tagintostack/)
- makes new clients attach into the stack area when you toggle a new tag into view
- this means your master area will remain unchanged when toggling views
- [tagmonfixfs](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagmonfixfs-6.2.diff)
- allows moving a fullscreen window to another monitor while remaining in fullscreen

33
dwm.c
View File

@ -2751,6 +2751,39 @@ toggleview(const Arg *arg)
int i;
#endif // PERTAG_PATCH
#if TAGINTOSTACK_ALLMASTER_PATCH
Client *const selected = selmon->sel;
// clients in the master area should be the same after we add a new tag
Client **const masters = calloc(selmon->nmaster, sizeof(Client *));
if (!masters) {
die("fatal: could not calloc() %u bytes \n", selmon->nmaster * sizeof(Client *));
}
// collect (from last to first) references to all clients in the master area
Client *c;
size_t i;
for (c = nexttiled(selmon->clients), i = 0; c && i < selmon->nmaster; c = nexttiled(c->next), ++i)
masters[selmon->nmaster - (i + 1)] = c;
// put the master clients at the front of the list
// > go from the 'last' master to the 'first'
for (size_t i = 0; i < selmon->nmaster; ++i)
if (masters[i])
pop(masters[i]);
free(masters);
// we also want to be sure not to mutate the focus
focus(selected);
#elif TAGINTOSTACK_ONEMASTER_PATCH
// the first visible client should be the same after we add a new tag
// we also want to be sure not to mutate the focus
Client *const c = nexttiled(selmon->clients);
if (c) {
Client * const selected = selmon->sel;
pop(c);
focus(selected);
}
#endif // TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH
#if !EMPTYVIEW_PATCH
if (newtagset) {
#endif // EMPTYVIEW_PATCH

View File

@ -326,6 +326,21 @@
*/
#define TAGALLMON_PATCH 0
/* This patch makes new clients attach into the stack area when you toggle a new tag into
* view. This means your master area will remain unchanged when toggling views.
* The allmaster patch will cause all clients in the master area to be left alone. This patch
* takes precedence over the onemaster tagintostack patch.
* https://dwm.suckless.org/patches/tagintostack/
*/
#define TAGINTOSTACK_ALLMASTER_PATCH 0
/* This patch makes new clients attach into the stack area when you toggle a new tag into
* view. This means your master area will remain unchanged when toggling views.
* The onemaster patch will cause the first client in the master area to be left alone.
* https://dwm.suckless.org/patches/tagintostack/
*/
#define TAGINTOSTACK_ONEMASTER_PATCH 0
/* If you try to send a fullscreen window to an adjacent monitor using tagmon then
* the window is moved behind the scenes, but it remains in fullscreen on the original
* monitor until you exit fullscreen view (at which point it will appear on the adjacent