-
Notifications
You must be signed in to change notification settings - Fork 0
/
04-attachaside.diff
37 lines (36 loc) · 1.09 KB
/
04-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
--- dwm-6.0-original/dwm.c 2014-01-23 19:17:20.742417045 +0100
+++ dwm-6.0/dwm.c 2014-01-23 19:24:21.754048536 +0100
@@ -160,6 +160,7 @@ static Bool applysizehints(Client *c, in
static void arrange(Monitor *m);
static void arrangemon(Monitor *m);
static void attach(Client *c);
+static void attachaside(Client *c);
static void attachstack(Client *c);
static void buttonpress(XEvent *e);
static void checkotherwm(void);
@@ -418,6 +419,17 @@ attach(Client *c) {
}
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;
@@ -1155,7 +1167,7 @@ manage(Window w, XWindowAttributes *wa)
c->isfloating = c->oldstate = 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 */
setclientstate(c, NormalState);