main.c
changeset 801 9f2426241f09
parent 800 6133edf536de
child 812 8992a53a0d6a
equal deleted inserted replaced
800:6133edf536de 801:9f2426241f09
    16 #include <X11/Xproto.h>
    16 #include <X11/Xproto.h>
    17 
    17 
    18 /* extern */
    18 /* extern */
    19 
    19 
    20 char stext[256];
    20 char stext[256];
    21 int screen, sw, sh, wax, way, waw, wah;
    21 int screen, sx, sy, sw, sh, wax, way, waw, wah;
    22 unsigned int bh, ntags, numlockmask;
    22 unsigned int bh, ntags, numlockmask;
    23 Atom wmatom[WMLast], netatom[NetLast];
    23 Atom wmatom[WMLast], netatom[NetLast];
    24 Bool *seltag;
    24 Bool *seltag;
    25 Bool selscreen = True;
    25 Bool selscreen = True;
    26 Client *clients = NULL;
    26 Client *clients = NULL;
   179 	dc.sel[ColBorder] = initcolor(SELBORDERCOLOR);
   179 	dc.sel[ColBorder] = initcolor(SELBORDERCOLOR);
   180 	dc.sel[ColBG] = initcolor(SELBGCOLOR);
   180 	dc.sel[ColBG] = initcolor(SELBGCOLOR);
   181 	dc.sel[ColFG] = initcolor(SELFGCOLOR);
   181 	dc.sel[ColFG] = initcolor(SELFGCOLOR);
   182 	initfont(FONT);
   182 	initfont(FONT);
   183 	/* geometry */
   183 	/* geometry */
       
   184 	sx = sy = 0;
   184 	sw = DisplayWidth(dpy, screen);
   185 	sw = DisplayWidth(dpy, screen);
   185 	sh = DisplayHeight(dpy, screen);
   186 	sh = DisplayHeight(dpy, screen);
   186 	initlayouts();
   187 	initlayouts();
   187 	/* bar */
   188 	/* bar */
   188 	dc.h = bh = dc.font.height + 2;
   189 	dc.h = bh = dc.font.height + 2;
   189 	wa.override_redirect = 1;
   190 	wa.override_redirect = 1;
   190 	wa.background_pixmap = ParentRelative;
   191 	wa.background_pixmap = ParentRelative;
   191 	wa.event_mask = ButtonPressMask | ExposureMask;
   192 	wa.event_mask = ButtonPressMask | ExposureMask;
   192 	barwin = XCreateWindow(dpy, root, 0, (TOPBAR ? 0 : sh - bh), sw, bh, 0,
   193 	barwin = XCreateWindow(dpy, root, sx, sy + (TOPBAR ? 0 : sh - bh), sw, bh, 0,
   193 			DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen),
   194 			DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen),
   194 			CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
   195 			CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
   195 	XDefineCursor(dpy, barwin, cursor[CurNormal]);
   196 	XDefineCursor(dpy, barwin, cursor[CurNormal]);
   196 	XMapRaised(dpy, barwin);
   197 	XMapRaised(dpy, barwin);
   197 	strcpy(stext, "dwm-"VERSION);
   198 	strcpy(stext, "dwm-"VERSION);
   198 	/* windowarea */
   199 	/* windowarea */
   199 	wax = 0;
   200 	wax = sx;
   200 	way = (TOPBAR ? bh : 0);
   201 	way = sy + (TOPBAR ? bh : 0);
   201 	wah = sh - bh;
   202 	wah = sh - bh;
   202 	waw = sw;
   203 	waw = sw;
   203 	/* pixmap for everything */
   204 	/* pixmap for everything */
   204 	dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
   205 	dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
   205 	dc.gc = XCreateGC(dpy, root, 0, 0);
   206 	dc.gc = XCreateGC(dpy, root, 0, 0);