summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/dwm.c b/dwm.c
index 1909d4b..4c001fa 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1,4 +1,4 @@
1#define XINULATOR /* debug, simulates dual head */ 1//#define XINULATOR /* debug, simulates dual head */
2/* See LICENSE file for copyright and license details. 2/* See LICENSE file for copyright and license details.
3 * 3 *
4 * dynamic window manager is designed like any other X client as well. It is 4 * dynamic window manager is designed like any other X client as well. It is
@@ -1649,9 +1649,11 @@ updatebarpos(Monitor *m) {
1649 1649
1650void 1650void
1651updategeom(void) { 1651updategeom(void) {
1652 int i, n = 1; 1652 int i, di, n = 1, x, y;
1653 unsigned int dui;
1653 Client *c; 1654 Client *c;
1654 Monitor *newmons = NULL, *m, *tm; 1655 Monitor *newmons = NULL, *m, *tm;
1656 Window dummy;
1655 1657
1656#ifdef XINULATOR 1658#ifdef XINULATOR
1657 n = 2; 1659 n = 2;
@@ -1720,16 +1722,6 @@ updategeom(void) {
1720 m->showbar = showbar; 1722 m->showbar = showbar;
1721 m->topbar = topbar; 1723 m->topbar = topbar;
1722 updatebarpos(m); 1724 updatebarpos(m);
1723 /* reassign all clients with same screen number */
1724 for(tm = mons; tm; tm = tm->next)
1725 if(tm->screen_number == m->screen_number) {
1726 m->clients = tm->clients;
1727 m->sel = m->stack = tm->stack;
1728 tm->clients = NULL;
1729 tm->stack = NULL;
1730 for(c = m->clients; c; c = c->next)
1731 c->mon = m;
1732 }
1733 } 1725 }
1734 1726
1735 /* reassign left over clients of disappeared monitors */ 1727 /* reassign left over clients of disappeared monitors */
@@ -1744,18 +1736,13 @@ updategeom(void) {
1744 } 1736 }
1745 1737
1746 /* select focused monitor */ 1738 /* select focused monitor */
1747 if(!selmon) { 1739 selmon = newmons;
1748 selmon = newmons; 1740 if(XQueryPointer(dpy, root, &dummy, &dummy, &x, &y, &di, &di, &dui))
1749 int di, x, y; 1741 for(m = newmons; m; m = m->next)
1750 unsigned int dui; 1742 if(INRECT(x, y, m->wx, m->wy, m->ww, m->wh)) {
1751 Window dummy; 1743 selmon = m;
1752 if(XQueryPointer(dpy, root, &dummy, &dummy, &x, &y, &di, &di, &dui)) 1744 break;
1753 for(m = newmons; m; m = m->next) 1745 }
1754 if(INRECT(x, y, m->wx, m->wy, m->ww, m->wh)) {
1755 selmon = m;
1756 break;
1757 }
1758 }
1759 1746
1760 /* final assignment of new monitors */ 1747 /* final assignment of new monitors */
1761 cleanupmons(); 1748 cleanupmons();