diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 13 |
1 files changed, 9 insertions, 4 deletions
| @@ -121,8 +121,8 @@ typedef struct { | |||
| 121 | } Layout; | 121 | } Layout; |
| 122 | 122 | ||
| 123 | struct Monitor { | 123 | struct 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 */ |
| 239 | static char stext[256], ntext[8]; | 240 | static char stext[256], ntext[8]; |
| 240 | static int screen; | 241 | static int screen; |
| 241 | static int sw, sh; /* X display screen geometry x, y, width, height */ | 242 | static int sw, sh; /* X display screen geometry width, height */ |
| 242 | static int bh, blw = 0; /* bar geometry */ | 243 | static int bh, blw = 0; /* bar geometry */ |
| 243 | static int (*xerrorxlib)(Display *, XErrorEvent *); | 244 | static int (*xerrorxlib)(Display *, XErrorEvent *); |
| 244 | static unsigned int numlockmask = 0; | 245 | static unsigned int numlockmask = 0; |
| @@ -276,6 +277,7 @@ void | |||
| 276 | applyrules(Client *c) { | 277 | applyrules(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; |
