1319 XSetWindowAttributes wa; |
1319 XSetWindowAttributes wa; |
1320 |
1320 |
1321 /* init screen */ |
1321 /* init screen */ |
1322 screen = DefaultScreen(dpy); |
1322 screen = DefaultScreen(dpy); |
1323 root = RootWindow(dpy, screen); |
1323 root = RootWindow(dpy, screen); |
1324 initfont(FONT); |
1324 initfont(font); |
1325 sx = 0; |
1325 sx = 0; |
1326 sy = 0; |
1326 sy = 0; |
1327 sw = DisplayWidth(dpy, screen); |
1327 sw = DisplayWidth(dpy, screen); |
1328 sh = DisplayHeight(dpy, screen); |
1328 sh = DisplayHeight(dpy, screen); |
1329 bh = dc.font.height + 2; |
1329 bh = dc.h = dc.font.height + 2; |
1330 lt = layouts; |
1330 lt = layouts; |
1331 updategeom(); |
1331 updategeom(); |
1332 |
1332 |
1333 /* init atoms */ |
1333 /* init atoms */ |
1334 wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); |
1334 wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); |
1342 wa.cursor = cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); |
1342 wa.cursor = cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); |
1343 cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); |
1343 cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); |
1344 cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur); |
1344 cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur); |
1345 |
1345 |
1346 /* init appearance */ |
1346 /* init appearance */ |
1347 dc.norm[ColBorder] = getcolor(NORMBORDERCOLOR); |
1347 dc.norm[ColBorder] = getcolor(normbordercolor); |
1348 dc.norm[ColBG] = getcolor(NORMBGCOLOR); |
1348 dc.norm[ColBG] = getcolor(normbgcolor); |
1349 dc.norm[ColFG] = getcolor(NORMFGCOLOR); |
1349 dc.norm[ColFG] = getcolor(normfgcolor); |
1350 dc.sel[ColBorder] = getcolor(SELBORDERCOLOR); |
1350 dc.sel[ColBorder] = getcolor(selbordercolor); |
1351 dc.sel[ColBG] = getcolor(SELBGCOLOR); |
1351 dc.sel[ColBG] = getcolor(selbgcolor); |
1352 dc.sel[ColFG] = getcolor(SELFGCOLOR); |
1352 dc.sel[ColFG] = getcolor(selfgcolor); |
1353 initfont(FONT); |
|
1354 dc.h = bh; |
|
1355 dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen)); |
1353 dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen)); |
1356 dc.gc = XCreateGC(dpy, root, 0, 0); |
1354 dc.gc = XCreateGC(dpy, root, 0, 0); |
1357 XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); |
1355 XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter); |
1358 if(!dc.font.set) |
1356 if(!dc.font.set) |
1359 XSetFont(dpy, dc.gc, dc.font.xfont->fid); |
1357 XSetFont(dpy, dc.gc, dc.font.xfont->fid); |