summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <anselm@garbe.us>2009-07-09 21:52:17 +0100
committerAnselm R Garbe <anselm@garbe.us>2009-07-09 21:52:17 +0100
commit758b100d12ba1c52b5d7479e3ed334ba89e701f8 (patch)
treea09b2e0e1470bd8a3ff35ac379b5decfe4105386 /dwm.c
parentreverting to optimised compiler options, current state seems stable (diff)
downloaddwm-758b100d12ba1c52b5d7479e3ed334ba89e701f8.tar.gz
dwm-758b100d12ba1c52b5d7479e3ed334ba89e701f8.zip
extended rule to apply monitors if set up accordingly
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/dwm.c b/dwm.c
index 5822944..4d1493b 100644
--- a/dwm.c
+++ b/dwm.c
@@ -121,8 +121,8 @@ typedef struct {
121} Layout; 121} Layout;
122 122
123struct Monitor { 123struct Monitor {
124 int screen_number;
125 float mfact; 124 float mfact;
125 int num;
126 int by; /* bar geometry */ 126 int by; /* bar geometry */
127 int mx, my, mw, mh; /* screen size */ 127 int mx, my, mw, mh; /* screen size */
128 int wx, wy, ww, wh; /* window area */ 128 int wx, wy, ww, wh; /* window area */
@@ -145,6 +145,7 @@ typedef struct {
145 const char *title; 145 const char *title;
146 unsigned int tags; 146 unsigned int tags;
147 Bool isfloating; 147 Bool isfloating;
148 int monitor;
148} Rule; 149} Rule;
149 150
150/* function declarations */ 151/* function declarations */
@@ -238,7 +239,7 @@ static void zoom(const Arg *arg);
238/* variables */ 239/* variables */
239static char stext[256], ntext[8]; 240static char stext[256], ntext[8];
240static int screen; 241static int screen;
241static int sw, sh; /* X display screen geometry x, y, width, height */ 242static int sw, sh; /* X display screen geometry width, height */
242static int bh, blw = 0; /* bar geometry */ 243static int bh, blw = 0; /* bar geometry */
243static int (*xerrorxlib)(Display *, XErrorEvent *); 244static int (*xerrorxlib)(Display *, XErrorEvent *);
244static unsigned int numlockmask = 0; 245static unsigned int numlockmask = 0;
@@ -276,6 +277,7 @@ void
276applyrules(Client *c) { 277applyrules(Client *c) {
277 unsigned int i; 278 unsigned int i;
278 const Rule *r; 279 const Rule *r;
280 Monitor *m;
279 XClassHint ch = { 0 }; 281 XClassHint ch = { 0 };
280 282
281 /* rule matching */ 283 /* rule matching */
@@ -289,6 +291,9 @@ applyrules(Client *c) {
289 { 291 {
290 c->isfloating = r->isfloating; 292 c->isfloating = r->isfloating;
291 c->tags |= r->tags; 293 c->tags |= r->tags;
294 for(m = mons; m && m->num != r->monitor; m = m->next);
295 if(m)
296 c->mon = m;
292 } 297 }
293 } 298 }
294 if(ch.res_class) 299 if(ch.res_class)
@@ -1698,7 +1703,7 @@ updategeom(void) {
1698#ifdef XINERAMA 1703#ifdef XINERAMA
1699 if(XineramaIsActive(dpy)) { 1704 if(XineramaIsActive(dpy)) {
1700 for(i = 0, m = newmons; m; m = m->next, i++) { 1705 for(i = 0, m = newmons; m; m = m->next, i++) {
1701 m->screen_number = info[i].screen_number; 1706 m->num = info[i].screen_number;
1702 m->mx = m->wx = info[i].x_org; 1707 m->mx = m->wx = info[i].x_org;
1703 m->my = m->wy = info[i].y_org; 1708 m->my = m->wy = info[i].y_org;
1704 m->mw = m->ww = info[i].width; 1709 m->mw = m->ww = info[i].width;
@@ -1710,7 +1715,7 @@ updategeom(void) {
1710#endif /* XINERAMA */ 1715#endif /* XINERAMA */
1711 /* default monitor setup */ 1716 /* default monitor setup */
1712 { 1717 {
1713 m->screen_number = 0; 1718 m->num = 0;
1714 m->mx = m->wx = 0; 1719 m->mx = m->wx = 0;
1715 m->my = m->wy = 0; 1720 m->my = m->wy = 0;
1716 m->mw = m->ww = sw; 1721 m->mw = m->ww = sw;