added some dual head simulator code fa5ae54b
Anselm R Garbe · 2009-06-23 19:00 1 file(s) · +24 −4
dwm.c +24 −4
1 +
#define XINULATOR /* debug, simulates dual head */
1 2
/* See LICENSE file for copyright and license details.
2 3
 *
3 4
 * dynamic window manager is designed like any other X client as well. It is
1158 1159
1159 1160
Client *
1160 1161
nexttiled(Client *c) {
1161 -
	// TODO: m handling
1162 1162
	for(; c && (c->isfloating || !ISVISIBLE(c)); c = c->next);
1163 1163
	return c;
1164 1164
}
1593 1593
	XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
1594 1594
	detach(c);
1595 1595
	detachstack(c);
1596 -
	if(selmon->sel == c)
1596 +
	if(c->mon->sel == c) {
1597 +
		c->mon->sel = c->mon->stack;
1597 1598
		focus(NULL);
1599 +
	}
1598 1600
	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
1599 1601
	setclientstate(c, WithdrawnState);
1600 1602
	free(c);
1651 1653
	Client *c;
1652 1654
	Monitor *newmons = NULL, *m, *tm;
1653 1655
1654 -
#ifdef XINERAMA
1656 +
#ifdef XINULATOR
1657 +
	n = 2;
1658 +
#elif defined(XINERAMA)
1655 1659
	XineramaScreenInfo *info = NULL;
1656 1660
1657 1661
	if(XineramaIsActive(dpy))
1665 1669
	}
1666 1670
1667 1671
	/* initialise monitor(s) */
1668 -
#ifdef XINERAMA
1672 +
#ifdef XINULATOR
1673 +
	if(1) {
1674 +
		m = newmons;
1675 +
		m->screen_number = 0;
1676 +
		m->wx = sx;
1677 +
		m->my = m->wy = sy;
1678 +
		m->ww = sw;
1679 +
		m->mh = m->wh = sh / 2;
1680 +
		m = newmons->next;
1681 +
		m->screen_number = 1;
1682 +
		m->wx = sx;
1683 +
		m->my = m->wy = sy + sh / 2;
1684 +
		m->ww = sw;
1685 +
		m->mh = m->wh = sh / 2;
1686 +
	}
1687 +
	else
1688 +
#elif defined(XINERAMA)
1669 1689
	if(XineramaIsActive(dpy)) {
1670 1690
		for(i = 0, m = newmons; m; m = m->next, i++) {
1671 1691
			m->screen_number = info[i].screen_number;