1. Nicola Paolucci
  2. dwm

Commits

Nicola Paolucci  committed 9f1b223

Replaced attachabove with attachaside: http://dwm.suckless.org/patches/attachaside

  • Participants
  • Parent commits cb1b56a
  • Branches default

Comments (0)

Files changed (1)

File dwm.c

View file
 static void arrange(Monitor *m);
 static void arrangemon(Monitor *m);
 static void attach(Client *c);
-static void attachabove(Client *c);
+static void attachaside(Client *c);
 static void attachstack(Client *c);
 static void buttonpress(XEvent *e);
 static void checkotherwm(void);
 }
 
 void
-attachabove(Client *c) {
-	if(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating) {
-		attach(c);
-		return;
-	}
-
-	Client *at;
-	for(at = c->mon->clients; at->next != c->mon->sel; at = at->next);
-	c->next = at->next;
-	at->next = c;
+attachaside(Client *c) {
+ Client *at = nexttiled(c->mon->clients);;
+ if(c->mon->sel == NULL || c->mon->sel->isfloating || !at) {
+   attach(c);
+   return;
+ }
+ c->next = at->next;
+ at->next = c;
 }
 
 void
 		c->isfloating = c->oldstate = trans != None || c->isfixed;
 	if(c->isfloating)
 		XRaiseWindow(dpy, c->win);
-	attachabove(c);
+	attachaside(c);
 	attachstack(c);
 	XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
 	                (unsigned char *) &(c->win), 1);