dwm-meillo

diff wm.c @ 34:cd30cce52b78

added logo+description
author Anselm R. Garbe <garbeam@wmii.de>
date Thu, 13 Jul 2006 09:32:22 +0200
parents e90449e03167
children
line diff
     1.1 --- a/wm.c	Thu Jul 13 01:55:54 2006 +0200
     1.2 +++ b/wm.c	Thu Jul 13 09:32:22 2006 +0200
     1.3 @@ -37,17 +37,17 @@
     1.4  int tsel = Tdev; /* default tag */
     1.5  int screen, sx, sy, sw, sh, th;
     1.6  
     1.7 -Brush brush = {0};
     1.8 +DC dc = {0};
     1.9  Client *clients = NULL;
    1.10  Client *stack = NULL;
    1.11  
    1.12  static Bool other_wm_running;
    1.13  static const char version[] =
    1.14 -	"gridwm - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
    1.15 +	"dwm - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
    1.16  static int (*x_error_handler) (Display *, XErrorEvent *);
    1.17  
    1.18  static void
    1.19 -usage() {	error("usage: gridwm [-v]\n"); }
    1.20 +usage() {	error("usage: dwm [-v]\n"); }
    1.21  
    1.22  static void
    1.23  scan_wins()
    1.24 @@ -149,7 +149,7 @@
    1.25  			|| (error->request_code == X_GrabKey
    1.26  				&& error->error_code == BadAccess))
    1.27  		return 0;
    1.28 -	fprintf(stderr, "gridwm: fatal error: request code=%d, error code=%d\n",
    1.29 +	fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n",
    1.30  			error->request_code, error->error_code);
    1.31  	return x_error_handler(dpy, error); /* may call exit() */
    1.32  }
    1.33 @@ -203,7 +203,7 @@
    1.34  
    1.35  	dpy = XOpenDisplay(0);
    1.36  	if(!dpy)
    1.37 -		error("gridwm: cannot connect X server\n");
    1.38 +		error("dwm: cannot connect X server\n");
    1.39  
    1.40  	screen = DefaultScreen(dpy);
    1.41  	root = RootWindow(dpy, screen);
    1.42 @@ -216,7 +216,7 @@
    1.43  	XFlush(dpy);
    1.44  
    1.45  	if(other_wm_running)
    1.46 -		error("gridwm: another window manager is already running\n");
    1.47 +		error("dwm: another window manager is already running\n");
    1.48  
    1.49  	sx = sy = 0;
    1.50  	sw = DisplayWidth(dpy, screen);
    1.51 @@ -244,20 +244,19 @@
    1.52  	update_keys();
    1.53  
    1.54  	/* style */
    1.55 -	loadcolors(screen, &brush, BGCOLOR, FGCOLOR, BORDERCOLOR);
    1.56 -	loadfont(&brush.font, FONT);
    1.57 +	initcolors(BGCOLOR, FGCOLOR, BORDERCOLOR);
    1.58 +	initfont(&dc.font, FONT);
    1.59  
    1.60 -	th = texth(&brush.font);
    1.61 +	th = texth(&dc.font);
    1.62  
    1.63 -	brush.drawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen));
    1.64 -	brush.gc = XCreateGC(dpy, root, 0, 0);
    1.65 +	dc.drawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen));
    1.66 +	dc.gc = XCreateGC(dpy, root, 0, 0);
    1.67  
    1.68  	wa.event_mask = SubstructureRedirectMask | EnterWindowMask \
    1.69  					| LeaveWindowMask;
    1.70  	wa.cursor = cursor[CurNormal];
    1.71  	XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa);
    1.72  
    1.73 -	arrange = grid;
    1.74  	scan_wins();
    1.75  
    1.76  	while(running) {