about summary refs log tree commit diff stats
path: root/config.default.h
Commit message (Expand)AuthorAgeFilesLines
* simplifying regexps in config samples 3.5Anselm R. Garbe2007-02-141-3/+3
* treating acroread and mplayer floating by defaultAnselm R. Garbe2007-02-091-0/+2
* added TOPBAR option for making the bar appear what the user likesAnselm R. Garbe2007-02-081-0/+1
* I prefer BORDERPX=1Anselm R. Garbe2007-01-191-1/+1
* moved BORDERPX to config.*.hAnselm R. Garbe2007-01-171-0/+1
* removed firefox rule from default.hAnselm R. Garbe2007-01-161-1/+0
* applied new default colorsAnselm R. Garbe2007-01-161-5/+5
* implemented new color scheme accordingly to Sanders proposalAnselm R. Garbe2007-01-141-2/+2
* removed mode label stuffAnselm R. Garbe2007-01-141-1/+1
* added comment to %u in config.default.h, added Button{4.5} support on mode labelAnselm R. Garbe2007-01-101-2/+2
* implemented nmaster appearance in mode label (using %u)Anselm R. Garbe2007-01-081-1/+1
* I received Sander's complain just in time ;) 2.9Anselm R. Garbe2007-01-081-4/+4
* fofofoAnselm R. Garbe2007-01-081-4/+4
* extended default tags to 1-9Anselm R. Garbe2007-01-081-1/+17
* changed shortcuts to M-i and M-dAnselm R. Garbe2007-01-051-2/+2
* changed plus key to MODKEY-Shift-plus (US-layout restrictions ;)Anselm R. Garbe2007-01-051-1/+1
* added MODKEY-{plus,minus} shortcuts (increasing/decreasing master clients)Anselm R. Garbe2007-01-051-0/+2
* experimental version which allows master clients being increased/decreasedAnselm R. Garbe2007-01-051-0/+1
* correctionsarg@mig292007-01-021-1/+1
* next version will contain updated copyright noticearg@mig292007-01-021-1/+1
* found compromise for fonts 2.6arg@mig292006-12-071-1/+1
* nah, people should define 'fixed' to be compatible with their localearg@mig292006-12-071-1/+1
* using a UTF-8 capable fixed fontarg@mig292006-12-071-1/+1
* removed viewall(), replaced with view(-1); added tag(-1) to tag a client with...arg@mig292006-11-301-1/+2
* returning to old Key structarg@mig292006-11-271-33/+32
* changing Key.func into Key.func[NFUNCS], this allows sequences execution of f...arg@mig292006-11-271-34/+35
* added togglefloat to hg tip (i consider this useful for some cases), using MO...arg@mig292006-11-271-0/+1
* renamed resizecol into resizemaster 2.1arg@mig292006-10-311-2/+2
* added screen-border snapping in floating mode, feels quite wellarg@mig292006-10-301-0/+1
* applied sander's config.*h nitpick patcharg@mig292006-10-261-1/+1
* code polishing, removed unnecessary newlinesAnselm R. Garbe2006-10-061-2/+1
* removed the stack position stuffAnselm R. Garbe2006-10-051-7/+4
* changing MASTER value from percent into per millAnselm R. Garbe2006-10-051-3/+3
* keep master ratio on resizecol -> arrangeAnselm R. Garbe2006-10-051-2/+2
* added symbols for different modesAnselm R. Garbe2006-09-291-1/+2
* removed the direction flippingAnselm R. Garbe2006-09-291-2/+0
* small changeAnselm R. Garbe2006-09-291-1/+1
* added the new dotile as described on mlAnselm R. Garbe2006-09-291-0/+2
* first step to a more flexible dotile() algorithmAnselm R. Garbe2006-09-291-1/+3
* changed order of colordefs in config.h's, changed config.arg.h to fit to new ...arg@mmvi2006-09-261-3/+3
* implemented the maximization as I described on the mailinglist, this feels be...arg@mmvi2006-09-221-1/+0
* made args mode symbols the default ones (the default ones look too ugly)Anselm R. Garbe2006-09-061-2/+2
* renamed resizetile into resizecolAnselm R. Garbe2006-09-051-2/+2
* well ok, added Mod-s to default bindings (however, I don't need it)Anselm R. Garbe2006-09-051-0/+1
* s/growcol/resizetile/gAnselm R. Garbe2006-09-051-1/+1
* I really need column growing, now pushing upstreamAnselm R. Garbe2006-09-051-0/+1
* changed shortcut into Mod1-0Anselm R. Garbe2006-08-311-1/+1
* added viewall to mainstream (only Ross Mohns version, not the toggle)Anselm R. Garbe2006-08-311-0/+1
* applied sanders somepatches.patchAnselm R. Garbe2006-08-281-1/+1
* changed order of optionsAnselm R. Garbe2006-08-251-2/+2
span> ^
1076f2b
72707c2 ^
15abade ^
bf35794 ^
1076f2b

cdbc84b ^
8d11163 ^













b3419f4 ^






9e56e1d ^
b3419f4 ^




b3419f4 ^
39677ec ^
439e15d ^
1df4559 ^
83aa110 ^
1df4559 ^

199a601 ^
2aef8b9 ^
1df4559 ^

f841501 ^
ab3d6a7 ^
83aa110 ^

2aef8b9 ^
1df4559 ^
3399650 ^
e750878 ^
1df4559 ^


e750878 ^
dba2306 ^
1df4559 ^
b9da4b0 ^
8012fcf ^
77044e8 ^
1df4559 ^
f251224 ^
77044e8 ^

1df4559 ^


70c7b43 ^
2aef8b9 ^
0937cc7 ^
8012fcf ^
9e8b325 ^
2aef8b9 ^
1df4559 ^
1df4559 ^
9e8b325 ^
8012fcf ^
1df4559 ^


ab3d6a7 ^
2aef8b9 ^
1df4559 ^

4cdbd52 ^

1df4559 ^


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
140
141
142
143
144
145
146
                                                      


                                                                             


                                                                              
  
                                                                            
                                                                        



                                                                              
  




                                                                              

                                                                             
  

                                                                             

                                                                            
  
                                                              

   
                   
                     
 
                                                   
                                                                     
 
                                                                          
                                                                    
                                                                   

                                                                           
 
                             
               
                       
                       
                                                 
                                                             
                                       
                     
                    
                                       
                                                  
                   
                     
                     
                      
                   

  
                













                                    






                                                                                                      
                                                      




                                                                                  
                           
 
              
                                                                              
                                                    

                                                                                
                                                                                               
                                                              

                                                                       
                                                                                    
                                                                                      

                                                       
                                                                                 
                                                                  
 
            


                                                                               
 
             
                                                                               
 
              
                                                                                                 
                                                                                         
                                                                              

                                                                                                


                                                                              
                                                                                 
                                                                 
                                                                                     
 
            
                                                                      
                                                             
                                                                           
 
           


                                                                                             
                                                                       
                                                                               

                                                                                          

            


                                                                                               
/* 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.c:main().
 */

#include "config.h"
#include <X11/Xlib.h>

/* mask shorthands, used in event.c and client.c */
#define BUTTONMASK		(ButtonPressMask | ButtonReleaseMask)

enum { BarTop, BarBot, BarOff };			/* bar position */
enum { CurNormal, CurResize, CurMove, CurLast };	/* cursor */
enum { ColBorder, ColFG, ColBG, ColLast };		/* color */
enum { NetSupported, NetWMName, NetLast };		/* EWMH atoms */
enum { WMProtocols, WMDelete, WMState, WMLast };	/* default atoms */

typedef struct Client Client;
struct Client {
	char name[256];
	int x, y, w, h;
	int rx, ry, rw, rh; /* revert geometry */
	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
	int minax, maxax, minay, maxay;
	int unmapped;
	long flags; 
	unsigned int border, oldborder;
	Bool isbanned, isfixed, ismax, isfloating;
	Bool *tags;
	Client *next;
	Client *prev;
	Client *snext;
	Window win;
};

typedef struct {
	int x, y, w, h;
	unsigned long norm[ColLast];
	unsigned long sel[ColLast];
	Drawable drawable;
	GC gc;
	struct {
		int ascent;
		int descent;
		int height;
		XFontSet set;
		XFontStruct *xfont;
	} font;
} DC; /* draw context */

extern const char *tags[];			/* all tags */
extern char stext[256];				/* status text */
extern int screen, sx, sy, sw, sh;		/* screen geometry */
extern int wax, way, wah, waw;			/* windowarea geometry */
extern unsigned int bh, blw, bpos;		/* bar height, bar layout label width, bar position */
extern unsigned int ntags, numlockmask;		/* number of tags, numlock mask */
extern void (*handler[LASTEvent])(XEvent *);	/* event handler */
extern Atom dwmtags, wmatom[WMLast], netatom[NetLast];
extern Bool selscreen, *seltag;			/* seltag is array of Bool */
extern Client *clients, *sel, *stack;		/* global client list and stack */
extern Cursor cursor[CurLast];
extern DC dc;					/* global draw context */
extern Display *dpy;
extern Window root, barwin;

/* client.c */
void attach(Client *c);			/* attaches c to global client list */
void ban(Client *c);			/* bans c */
void configure(Client *c);		/* send synthetic configure event */
void detach(Client *c);			/* detaches c from global client list */
void focus(Client *c);			/* focus c if visible && !NULL, or focus top visible */
void killclient(const char *arg);	/* kill sel  nicely */
void manage(Window w, XWindowAttributes *wa);	/* manage new client */
void resize(Client *c, int x, int y,
		int w, int h, Bool sizehints);	/* resize with given coordinates c*/
void togglefloating(const char *arg);	/* toggles sel between floating/tiled state */
void unban(Client *c);			/* unbans c */
void unmanage(Client *c);		/* destroy c */
void updatesizehints(Client *c);	/* update the size hint variables of c */
void updatetitle(Client *c);		/* update the name of c */

/* draw.c */
void drawstatus(void);			/* draw the bar */
void drawtext(const char *text, unsigned long col[ColLast]);	/* draw text */
unsigned int textw(const char *text);	/* return the width of text in px*/

/* event.c */
void grabkeys(void);			/* grab all keys defined in config.h */

/* layout.c */
void arrange(void);			/* arranges all windows depending on the layout in use */
void focusclient(const char *arg);	/* focuses next(1)/previous(-1) visible client */
const char *getsymbol(void);		/* returns symbol of enabled layout */
Bool isfloating(void);			/* returns True if floating layout is enabled */
Bool isarrange(void (*func)());		/* returns True if func is the layout function in use */
void initlayouts(void);			/* initialize layout array */
Client *nexttiled(Client *c);		/* returns tiled successor of c */
void restack(void);			/* restores z layers of all clients */
void setlayout(const char *arg);	/* sets layout, NULL means next layout */
void togglebar(const char *arg);	/* shows/hides the bar */
void togglemax(const char *arg);	/* toggles maximization of floating client */

/* main.c */
void updatebarpos(void);		/* updates the bar position */
void quit(const char *arg);		/* quit dwm nicely */
int xerror(Display *dsply, XErrorEvent *ee);	/* dwm's X error handler */

/* tag.c */
void compileregs(void);			/* initialize regexps of rules defined in config.h */
Bool isvisible(Client *c);		/* returns True if client is visible */
void settags(Client *c, Client *trans);	/* sets tags of c */
void tag(const char *arg);		/* tags sel with arg's index */
void toggletag(const char *arg);	/* toggles sel tags with arg's index */
void toggleview(const char *arg);	/* toggles the tag with arg's index (in)visible */
void view(const char *arg);		/* views the tag with arg's index */

/* util.c */
void *emallocz(unsigned int size);	/* allocates zero-initialized memory, exits on error */
void eprint(const char *errstr, ...);	/* prints errstr and exits with 1 */
void spawn(const char *arg);		/* forks a new subprocess with arg's cmd */