about summary refs log tree commit diff stats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-09-15 22:33:46 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-09-15 22:33:46 +0200
commite041ff70b0e4438e741405d994e13f91435ed321 (patch)
tree2ce24aa59038aa17e446b4a68c40eef7ae041630 /dwm.c
parent2d7bb8d7c974c1ae5430fa1561c850f0ea4623d3 (diff)
downloaddwm-e041ff70b0e4438e741405d994e13f91435ed321.tar.gz
backporting my intro-comment of old dwm.h
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/dwm.c b/dwm.c
index cd7c9e5..7d2a0de 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1,4 +1,33 @@
-/* See LICENSE file for copyright and license details. */
+/* See LICENSE file for copyright and license details.
+ *
+ * dynamic window manager is designed like any other X client as well. It is
+ * driven through handling X events. In contrast to other X clients, a window
+ * manager selects for SubstructureRedirectMask on the root window, to receive
+ * events about window (dis-)appearance.  Only one X connection at a time is
+ * allowed to select for this event mask.
+ *
+ * Calls to fetch an X event from the event queue are blocking.  Due reading
+ * status text from standard input, a select()-driven main loop has been
+ * implemented which selects for reads on the X connection and STDIN_FILENO to
+ * handle all data smoothly. The event handlers of dwm are organized in an
+ * array which is accessed whenever a new event has been fetched. This allows
+ * event dispatching in O(1) time.
+ *
+ * Each child of the root window is called a client, except windows which have
+ * set the override_redirect flag.  Clients are organized in a global
+ * doubly-linked client list, the focus history is remembered through a global
+ * stack list. Each client contains an array of Bools of the same size as the
+ * global tags array to indicate the tags of a client.  For each client dwm
+ * creates a small title window, which is resized whenever the (_NET_)WM_NAME
+ * properties are updated or the client is moved/resized.
+ *
+ * Keys and tagging rules are organized as arrays and defined in the config.h
+ * file. These arrays are kept static in event.o and tag.o respectively,
+ * because no other part of dwm needs access to them.  The current layout is
+ * represented by the lt pointer.
+ *
+ * To understand everything else, start reading main().
+ */
 #include <errno.h>
 #include <locale.h>
 #include <regex.h>
href='/akkartik/mu/blame/html/060rewrite_literal_string.cc.html?h=main&id=1f3bb2eda188f04271d318c36b57f69fd61552ef'>^
a654e4ec ^
e5c11a51 ^
70f4e9b6 ^
4a39d12d ^
9e751bb8 ^
a654e4ec ^





e5c11a51 ^






















a654e4ec ^


e5c11a51 ^
a654e4ec ^
204dae92 ^


201458e3 ^
204dae92 ^









201458e3 ^

204dae92 ^



201458e3 ^
204dae92 ^













201458e3 ^
204dae92 ^
fd7d8138 ^
201458e3 ^
204dae92 ^
2c678a4e ^
9e751bb8 ^

2c678a4e ^
9e751bb8 ^












204dae92 ^



201458e3 ^
2c678a4e ^
9e751bb8 ^
2c678a4e ^
9e751bb8 ^

2c678a4e ^
9e751bb8 ^

204dae92 ^


a654e4ec ^



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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139