main.c
changeset 353 8a06efe5b563
parent 352 5a8bdc3b37cb
child 357 27082985e51e
equal deleted inserted replaced
352:5a8bdc3b37cb 353:8a06efe5b563
    18 /* extern */
    18 /* extern */
    19 
    19 
    20 char stext[1024];
    20 char stext[1024];
    21 Bool *seltag;
    21 Bool *seltag;
    22 int screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
    22 int screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
    23 unsigned int ntags, numlockmask;
    23 unsigned int ntags, numlockmask, modew;
    24 Atom wmatom[WMLast], netatom[NetLast];
    24 Atom wmatom[WMLast], netatom[NetLast];
    25 Bool running = True;
    25 Bool running = True;
    26 Bool issel = True;
    26 Bool issel = True;
    27 Client *clients = NULL;
    27 Client *clients = NULL;
    28 Client *sel = NULL;
    28 Client *sel = NULL;
   119 	for(ntags = 0; tags[ntags]; ntags++);
   119 	for(ntags = 0; tags[ntags]; ntags++);
   120 	seltag = emallocz(sizeof(Bool) * ntags);
   120 	seltag = emallocz(sizeof(Bool) * ntags);
   121 	seltag[0] = True;
   121 	seltag[0] = True;
   122 
   122 
   123 	/* style */
   123 	/* style */
   124 	dc.bg = getcolor(BGCOLOR);
   124 	dc.norm[ColBG] = getcolor(NORMBGCOLOR);
   125 	dc.fg = getcolor(FGCOLOR);
   125 	dc.norm[ColFG] = getcolor(NORMFGCOLOR);
   126 	dc.border = getcolor(BORDERCOLOR);
   126 	dc.sel[ColBG] = getcolor(SELBGCOLOR);
       
   127 	dc.sel[ColFG] = getcolor(SELFGCOLOR);
       
   128 	dc.status[ColBG] = getcolor(STATUSBGCOLOR);
       
   129 	dc.status[ColFG] = getcolor(STATUSFGCOLOR);
   127 	setfont(FONT);
   130 	setfont(FONT);
   128 
   131 
       
   132 	modew = 0;
   129 	sx = sy = 0;
   133 	sx = sy = 0;
   130 	sw = DisplayWidth(dpy, screen);
   134 	sw = DisplayWidth(dpy, screen);
   131 	sh = DisplayHeight(dpy, screen);
   135 	sh = DisplayHeight(dpy, screen);
   132 	mw = (sw * MASTERW) / 100;
   136 	mw = (sw * MASTERW) / 100;
   133 
   137 
   134 	bx = by = 0;
   138 	bx = by = 0;
   135 	bw = sw;
   139 	bw = sw;
   136 	dc.h = bh = dc.font.height + 4;
   140 	dc.h = bh = dc.font.height + 2;
   137 	wa.override_redirect = 1;
   141 	wa.override_redirect = 1;
   138 	wa.background_pixmap = ParentRelative;
   142 	wa.background_pixmap = ParentRelative;
   139 	wa.event_mask = ButtonPressMask | ExposureMask;
   143 	wa.event_mask = ButtonPressMask | ExposureMask;
   140 	barwin = XCreateWindow(dpy, root, bx, by, bw, bh, 0, DefaultDepth(dpy, screen),
   144 	barwin = XCreateWindow(dpy, root, bx, by, bw, bh, 0, DefaultDepth(dpy, screen),
   141 			CopyFromParent, DefaultVisual(dpy, screen),
   145 			CopyFromParent, DefaultVisual(dpy, screen),