diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 31 |
1 files changed, 30 insertions, 1 deletions
| @@ -1,4 +1,33 @@ | |||
| 1 | /* See LICENSE file for copyright and license details. */ | 1 | /* See LICENSE file for copyright and license details. |
| 2 | * | ||
| 3 | * dynamic window manager is designed like any other X client as well. It is | ||
| 4 | * driven through handling X events. In contrast to other X clients, a window | ||
| 5 | * manager selects for SubstructureRedirectMask on the root window, to receive | ||
| 6 | * events about window (dis-)appearance. Only one X connection at a time is | ||
| 7 | * allowed to select for this event mask. | ||
| 8 | * | ||
| 9 | * Calls to fetch an X event from the event queue are blocking. Due reading | ||
| 10 | * status text from standard input, a select()-driven main loop has been | ||
| 11 | * implemented which selects for reads on the X connection and STDIN_FILENO to | ||
| 12 | * handle all data smoothly. The event handlers of dwm are organized in an | ||
| 13 | * array which is accessed whenever a new event has been fetched. This allows | ||
| 14 | * event dispatching in O(1) time. | ||
| 15 | * | ||
| 16 | * Each child of the root window is called a client, except windows which have | ||
| 17 | * set the override_redirect flag. Clients are organized in a global | ||
| 18 | * doubly-linked client list, the focus history is remembered through a global | ||
| 19 | * stack list. Each client contains an array of Bools of the same size as the | ||
| 20 | * global tags array to indicate the tags of a client. For each client dwm | ||
| 21 | * creates a small title window, which is resized whenever the (_NET_)WM_NAME | ||
| 22 | * properties are updated or the client is moved/resized. | ||
| 23 | * | ||
| 24 | * Keys and tagging rules are organized as arrays and defined in the config.h | ||
| 25 | * file. These arrays are kept static in event.o and tag.o respectively, | ||
| 26 | * because no other part of dwm needs access to them. The current layout is | ||
| 27 | * represented by the lt pointer. | ||
| 28 | * | ||
| 29 | * To understand everything else, start reading main(). | ||
| 30 | */ | ||
| 2 | #include <errno.h> | 31 | #include <errno.h> |
| 3 | #include <locale.h> | 32 | #include <locale.h> |
| 4 | #include <regex.h> | 33 | #include <regex.h> |
