Introduction
Introduction Statistics Contact Development Disclaimer Help
dwm-attachasideandbelow-6.4.diff - sites - public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log
Files
Refs
---
dwm-attachasideandbelow-6.4.diff (3237B)
---
1 diff --git a/dwm.c b/dwm.c
2 index e5efb6a..7b8d4a0 100644
3 --- a/dwm.c
4 +++ b/dwm.c
5 @@ -49,7 +49,8 @@
6 #define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (Shif…
7 #define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - …
8 * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - …
9 -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->selt…
10 +#define ISVISIBLEONTAG(C, T) ((C->tags & T))
11 +#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon…
12 #define LENGTH(X) (sizeof X / sizeof X[0])
13 #define MOUSEMASK (BUTTONMASK|PointerMotionMask)
14 #define WIDTH(X) ((X)->w + 2 * (X)->bw)
15 @@ -147,6 +148,7 @@ static int applysizehints(Client *c, int *x, int *y,…
16 static void arrange(Monitor *m);
17 static void arrangemon(Monitor *m);
18 static void attach(Client *c);
19 +static void attachBelow(Client *c);
20 static void attachstack(Client *c);
21 static void buttonpress(XEvent *e);
22 static void checkotherwm(void);
23 @@ -184,6 +186,7 @@ static void maprequest(XEvent *e);
24 static void monocle(Monitor *m);
25 static void motionnotify(XEvent *e);
26 static void movemouse(const Arg *arg);
27 +static Client *nexttagged(Client *c);
28 static Client *nexttiled(Client *c);
29 static void pop(Client *c);
30 static void propertynotify(XEvent *e);
31 @@ -408,6 +411,27 @@ attach(Client *c)
32 c->next = c->mon->clients;
33 c->mon->clients = c;
34 }
35 +void
36 +attachBelow(Client *c)
37 +{
38 + //If there is nothing on the monitor or the selected client is …
39 + if(c->mon->sel == NULL || c->mon->sel->isfloating) {
40 + Client *at = nexttagged(c);
41 + if(!at) {
42 + attach(c);
43 + return;
44 + }
45 + c->next = at->next;
46 + at->next = c;
47 + return;
48 + }
49 +
50 + //Set the new client's next property to the same as the current…
51 + c->next = c->mon->sel->next;
52 + //Set the currently selected clients next property to the new c…
53 + c->mon->sel->next = c;
54 +
55 +}
56
57 void
58 attachstack(Client *c)
59 @@ -1065,7 +1089,7 @@ manage(Window w, XWindowAttributes *wa)
60 c->isfloating = c->oldstate = trans != None || c->isfix…
61 if (c->isfloating)
62 XRaiseWindow(dpy, c->win);
63 - attach(c);
64 + attachBelow(c);
65 attachstack(c);
66 XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 3…
67 (unsigned char *) &(c->win), 1);
68 @@ -1193,6 +1217,16 @@ movemouse(const Arg *arg)
69 }
70 }
71
72 + Client *
73 +nexttagged(Client *c) {
74 + Client *walked = c->mon->clients;
75 + for(;
76 + walked && (walked->isfloating || !ISVISIBLEONTAG(walked…
77 + walked = walked->next
78 + );
79 + return walked;
80 +}
81 +
82 Client *
83 nexttiled(Client *c)
84 {
85 @@ -1418,7 +1452,7 @@ sendmon(Client *c, Monitor *m)
86 detachstack(c);
87 c->mon = m;
88 c->tags = m->tagset[m->seltags]; /* assign tags of target monit…
89 - attach(c);
90 + attachBelow(c);
91 attachstack(c);
92 focus(NULL);
93 arrange(NULL);
94 @@ -1898,6 +1932,7 @@ updategeom(void)
95 detachstack(c);
96 c->mon = mons;
97 attach(c);
98 + attachBelow(c);
99 attachstack(c);
100 }
101 if (m == selmon)
102 --
103 2.41.0
104
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.