summaryrefslogtreecommitdiffstats
path: root/wm.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-13 09:32:22 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-13 09:32:22 +0200
commit650a1fb4e1a798aca48a53739f5bb2649191bc1c (patch)
tree24684f376a1016a4ccbb01f3f96ca08c01383eee /wm.c
parentnew stuff (some warning elimination) (diff)
downloaddwm-650a1fb4e1a798aca48a53739f5bb2649191bc1c.tar.gz
dwm-650a1fb4e1a798aca48a53739f5bb2649191bc1c.zip
added logo+description
Diffstat (limited to 'wm.c')
-rw-r--r--wm.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/wm.c b/wm.c
index 6d67bfc..ed002f7 100644
--- a/wm.c
+++ b/wm.c
@@ -37,17 +37,17 @@ char stext[1024];
37int tsel = Tdev; /* default tag */ 37int tsel = Tdev; /* default tag */
38int screen, sx, sy, sw, sh, th; 38int screen, sx, sy, sw, sh, th;
39 39
40Brush brush = {0}; 40DC dc = {0};
41Client *clients = NULL; 41Client *clients = NULL;
42Client *stack = NULL; 42Client *stack = NULL;
43 43
44static Bool other_wm_running; 44static Bool other_wm_running;
45static const char version[] = 45static const char version[] =
46 "gridwm - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n"; 46 "dwm - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
47static int (*x_error_handler) (Display *, XErrorEvent *); 47static int (*x_error_handler) (Display *, XErrorEvent *);
48 48
49static void 49static void
50usage() { error("usage: gridwm [-v]\n"); } 50usage() { error("usage: dwm [-v]\n"); }
51 51
52static void 52static void
53scan_wins() 53scan_wins()
@@ -149,7 +149,7 @@ error_handler(Display *dpy, XErrorEvent *error)
149 || (error->request_code == X_GrabKey 149 || (error->request_code == X_GrabKey
150 && error->error_code == BadAccess)) 150 && error->error_code == BadAccess))
151 return 0; 151 return 0;
152 fprintf(stderr, "gridwm: fatal error: request code=%d, error code=%d\n", 152 fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n",
153 error->request_code, error->error_code); 153 error->request_code, error->error_code);
154 return x_error_handler(dpy, error); /* may call exit() */ 154 return x_error_handler(dpy, error); /* may call exit() */
155} 155}
@@ -203,7 +203,7 @@ main(int argc, char *argv[])
203 203
204 dpy = XOpenDisplay(0); 204 dpy = XOpenDisplay(0);
205 if(!dpy) 205 if(!dpy)
206 error("gridwm: cannot connect X server\n"); 206 error("dwm: cannot connect X server\n");
207 207
208 screen = DefaultScreen(dpy); 208 screen = DefaultScreen(dpy);
209 root = RootWindow(dpy, screen); 209 root = RootWindow(dpy, screen);
@@ -216,7 +216,7 @@ main(int argc, char *argv[])
216 XFlush(dpy); 216 XFlush(dpy);
217 217
218 if(other_wm_running) 218 if(other_wm_running)
219 error("gridwm: another window manager is already running\n"); 219 error("dwm: another window manager is already running\n");
220 220
221 sx = sy = 0; 221 sx = sy = 0;
222 sw = DisplayWidth(dpy, screen); 222 sw = DisplayWidth(dpy, screen);
@@ -244,20 +244,19 @@ main(int argc, char *argv[])
244 update_keys(); 244 update_keys();
245 245
246 /* style */ 246 /* style */
247 loadcolors(screen, &brush, BGCOLOR, FGCOLOR, BORDERCOLOR); 247 initcolors(BGCOLOR, FGCOLOR, BORDERCOLOR);
248 loadfont(&brush.font, FONT); 248 initfont(&dc.font, FONT);
249 249
250 th = texth(&brush.font); 250 th = texth(&dc.font);
251 251
252 brush.drawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen)); 252 dc.drawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen));
253 brush.gc = XCreateGC(dpy, root, 0, 0); 253 dc.gc = XCreateGC(dpy, root, 0, 0);
254 254
255 wa.event_mask = SubstructureRedirectMask | EnterWindowMask \ 255 wa.event_mask = SubstructureRedirectMask | EnterWindowMask \
256 | LeaveWindowMask; 256 | LeaveWindowMask;
257 wa.cursor = cursor[CurNormal]; 257 wa.cursor = cursor[CurNormal];
258 XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); 258 XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa);
259 259
260 arrange = grid;
261 scan_wins(); 260 scan_wins();
262 261
263 while(running) { 262 while(running) {