-
Notifications
You must be signed in to change notification settings - Fork 10
/
06-attachaside.diff
38 lines (37 loc) · 1.01 KB
/
06-attachaside.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff -r 9f79d36bd5e0 dwm.c
--- a/dwm.c Tue Sep 08 13:33:58 2009 +0100
+++ b/dwm.c Tue Sep 15 14:19:26 2009 +0200
@@ -153,6 +153,7 @@
static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact);
static void arrange(void);
static void attach(Client *c);
+static void attachaside(Client *c);
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
@@ -397,6 +398,17 @@
}
void
+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
attachstack(Client *c) {
c->snext = c->mon->stack;
c->mon->stack = c;
@@ -1105,7 +1117,7 @@
c->isfloating = trans != None || c->isfixed;
if(c->isfloating)
XRaiseWindow(dpy, c->win);
- attach(c);
+ attachaside(c);
attachstack(c);
XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */
XMapWindow(dpy, c->win);