dwm.c
changeset 1474 d39b21ff64f4
parent 1468 654a2e8064ae
child 1475 e47a47bd3ed4
equal deleted inserted replaced
1473:a4d3e32cb7ef 1474:d39b21ff64f4
  1681 		m->by = -bh;
  1681 		m->by = -bh;
  1682 }
  1682 }
  1683 
  1683 
  1684 void
  1684 void
  1685 updategeom(void) {
  1685 updategeom(void) {
  1686 	int i, n = 1;
  1686 	int i, n = 1, nn;
  1687 	Client *c;
  1687 	Client *c;
  1688 	Monitor *newmons = NULL, *m = NULL, *tm;
  1688 	Monitor *newmons = NULL, *m = NULL, *tm;
  1689 
  1689 
  1690 #ifdef XINERAMA
  1690 #ifdef XINERAMA
  1691 	XineramaScreenInfo *info = NULL;
  1691 	XineramaScreenInfo *info = NULL;
  1692 
  1692 
  1693 	if(XineramaIsActive(dpy))
  1693 	if(XineramaIsActive(dpy))
  1694 		info = XineramaQueryScreens(dpy, &n);
  1694 		info = XineramaQueryScreens(dpy, &n);
       
  1695 	for(i = 1, nn = n; i < n; i++)
       
  1696 		if(info[i - 1].x_org == info[i].x_org && info[i - 1].y_org == info[i].y_org
       
  1697 		&& info[i - 1].width == info[i].width && info[i - 1].height == info[i].height)
       
  1698 			--nn;
       
  1699 	n = nn; /* we only consider unique geometrys as separate screens */
  1695 #endif /* XINERAMA */
  1700 #endif /* XINERAMA */
  1696 	/* allocate monitor(s) for the new geometry setup */
  1701 	/* allocate monitor(s) for the new geometry setup */
  1697 	for(i = 0; i < n; i++) {
  1702 	for(i = 0; i < n; i++) {
  1698 		if(!(m = (Monitor *)malloc(sizeof(Monitor))))
  1703 		if(!(m = (Monitor *)malloc(sizeof(Monitor))))
  1699 			die("fatal: could not malloc() %u bytes\n", sizeof(Monitor));
  1704 			die("fatal: could not malloc() %u bytes\n", sizeof(Monitor));