sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-6.2-tagintostack-onemaster.diff (1023B)


      1 From 43fb204a53e3f1bee47f51a2f4e52e5bf242e314 Mon Sep 17 00:00:00 2001
      2 From: astier <aleksandrs.stier@uni-bielefeld.de>
      3 Date: Tue, 26 Feb 2019 01:04:55 +0100
      4 Subject: [PATCH] Attach clients from toggled tag into stack instead of master area
      5 
      6 New clients attach into the stack area when you toggle a new tag into
      7 view. This means your master area will remain unchanged when toggling
      8 views.
      9 ---
     10  dwm.c | 9 +++++++++
     11  1 file changed, 9 insertions(+)
     12 
     13 diff --git a/dwm.c b/dwm.c
     14 index 4465af1..567fa8b 100644
     15 --- a/dwm.c
     16 +++ b/dwm.c
     17 @@ -1739,6 +1739,15 @@ toggleview(const Arg *arg)
     18  {
     19  	unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
     20  
     21 +	// the first visible client should be the same after we add a new tag
     22 +	// we also want to be sure not to mutate the focus
     23 +	Client *const c = nexttiled(selmon->clients);
     24 +	if (c) {
     25 +		Client * const selected = selmon->sel;
     26 +		pop(c);
     27 +		focus(selected);
     28 +	}
     29 +
     30  	if (newtagset) {
     31  		selmon->tagset[selmon->seltags] = newtagset;
     32  		focus(NULL);
     33 -- 
     34 2.20.1