sites

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

dwm-attachbottom-6.2.diff (1507B)


      1 diff -up dwm-6.2/dwm.c dwm-6.2-attachbottom/dwm.c
      2 --- dwm-6.2/dwm.c	2019-02-02 13:55:28.000000000 +0100
      3 +++ dwm-6.2-attachbottom/dwm.c	2020-12-27 10:43:35.956867775 +0100
      4 @@ -147,6 +147,7 @@ static int applysizehints(Client *c, int
      5  static void arrange(Monitor *m);
      6  static void arrangemon(Monitor *m);
      7  static void attach(Client *c);
      8 +static void attachbottom(Client *c);
      9  static void attachstack(Client *c);
     10  static void buttonpress(XEvent *e);
     11  static void checkotherwm(void);
     12 @@ -407,6 +408,15 @@ attach(Client *c)
     13  }
     14  
     15  void
     16 +attachbottom(Client *c)
     17 +{
     18 +	Client **tc;
     19 +	c->next = NULL;
     20 +	for (tc = &c->mon->clients; *tc; tc = &(*tc)->next);
     21 +	*tc = c;
     22 +}
     23 +
     24 +void
     25  attachstack(Client *c)
     26  {
     27  	c->snext = c->mon->stack;
     28 @@ -1062,7 +1072,7 @@ manage(Window w, XWindowAttributes *wa)
     29  		c->isfloating = c->oldstate = trans != None || c->isfixed;
     30  	if (c->isfloating)
     31  		XRaiseWindow(dpy, c->win);
     32 -	attach(c);
     33 +	attachbottom(c);
     34  	attachstack(c);
     35  	XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
     36  		(unsigned char *) &(c->win), 1);
     37 @@ -1417,7 +1427,7 @@ sendmon(Client *c, Monitor *m)
     38  	detachstack(c);
     39  	c->mon = m;
     40  	c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
     41 -	attach(c);
     42 +	attachbottom(c);
     43  	attachstack(c);
     44  	focus(NULL);
     45  	arrange(NULL);
     46 @@ -1897,7 +1907,7 @@ updategeom(void)
     47  					m->clients = c->next;
     48  					detachstack(c);
     49  					c->mon = mons;
     50 -					attach(c);
     51 +					attachbottom(c);
     52  					attachstack(c);
     53  				}
     54  				if (m == selmon)