dwm.c
changeset 1156 987c8d5c0bf8
parent 1155 25e7987c7b18
child 1157 5fb97aa00e2f
equal deleted inserted replaced
1155:25e7987c7b18 1156:987c8d5c0bf8
  1446 		drawbar();
  1446 		drawbar();
  1447 }
  1447 }
  1448 
  1448 
  1449 void
  1449 void
  1450 setup(void) {
  1450 setup(void) {
  1451 	unsigned int i;
  1451 	unsigned int i, w;
  1452 	XSetWindowAttributes wa;
  1452 	XSetWindowAttributes wa;
  1453 
  1453 
  1454 	/* init screen */
  1454 	/* init screen */
  1455 	screen = DefaultScreen(dpy);
  1455 	screen = DefaultScreen(dpy);
  1456 	root = RootWindow(dpy, screen);
  1456 	root = RootWindow(dpy, screen);
  1501 	/* init layouts */
  1501 	/* init layouts */
  1502 	lt = &layouts[0];
  1502 	lt = &layouts[0];
  1503 
  1503 
  1504 	/* init bar */
  1504 	/* init bar */
  1505 	for(blw = i = 0; i < LENGTH(layouts); i++) {
  1505 	for(blw = i = 0; i < LENGTH(layouts); i++) {
  1506 		i = textw(layouts[i].symbol);
  1506 		w = textw(layouts[i].symbol);
  1507 		if(i > blw)
  1507 		if(w > blw)
  1508 			blw = i;
  1508 			blw = w;
  1509 	}
  1509 	}
  1510 	for(bgw = i = 0; i < LENGTH(geoms); i++) {
  1510 	for(bgw = i = 0; i < LENGTH(geoms); i++) {
  1511 		i = textw(geoms[i].symbol);
  1511 		w = textw(geoms[i].symbol);
  1512 		if(i > bgw)
  1512 		if(w > bgw)
  1513 			bgw = i;
  1513 			bgw = w;
  1514 	}
  1514 	}
  1515 
  1515 
  1516 	wa.override_redirect = 1;
  1516 	wa.override_redirect = 1;
  1517 	wa.background_pixmap = ParentRelative;
  1517 	wa.background_pixmap = ParentRelative;
  1518 	wa.event_mask = ButtonPressMask|ExposureMask;
  1518 	wa.event_mask = ButtonPressMask|ExposureMask;