summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/dwm.c b/dwm.c
index f20861e..5c27113 100644
--- a/dwm.c
+++ b/dwm.c
@@ -124,7 +124,7 @@ struct Monitor {
124 int screen_number; 124 int screen_number;
125 float mfact; 125 float mfact;
126 int by, btx; /* bar geometry */ 126 int by, btx; /* 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 */
129 unsigned int seltags; 129 unsigned int seltags;
130 unsigned int sellt; 130 unsigned int sellt;
@@ -239,7 +239,7 @@ static void tagmon(const Arg *arg);
239/* variables */ 239/* variables */
240static char stext[256]; 240static char stext[256];
241static int screen; 241static int screen;
242static int sx, sy, sw, sh; /* X display screen geometry x, y, width, height */ 242static int sw, sh; /* X display screen geometry x, y, width, height */
243static int bh, blw = 0; /* bar geometry */ 243static int bh, blw = 0; /* bar geometry */
244static int (*xerrorxlib)(Display *, XErrorEvent *); 244static int (*xerrorxlib)(Display *, XErrorEvent *);
245static unsigned int numlockmask = 0; 245static unsigned int numlockmask = 0;
@@ -302,19 +302,20 @@ applyrules(Client *c) {
302Bool 302Bool
303applysizehints(Client *c, int *x, int *y, int *w, int *h) { 303applysizehints(Client *c, int *x, int *y, int *w, int *h) {
304 Bool baseismin; 304 Bool baseismin;
305 Monitor *m = c->mon;
305 306
306 /* set minimum possible */ 307 /* set minimum possible */
307 *w = MAX(1, *w); 308 *w = MAX(1, *w);
308 *h = MAX(1, *h); 309 *h = MAX(1, *h);
309 310
310 if(*x > sx + sw) 311 if(*x > m->mx + m->mw)
311 *x = sw - WIDTH(c); 312 *x = m->mw - WIDTH(c);
312 if(*y > sy + sh) 313 if(*y > m->my + m->mh)
313 *y = sh - HEIGHT(c); 314 *y = m->mh - HEIGHT(c);
314 if(*x + *w + 2 * c->bw < sx) 315 if(*x + *w + 2 * c->bw < m->mx)
315 *x = sx; 316 *x = m->mx;
316 if(*y + *h + 2 * c->bw < sy) 317 if(*y + *h + 2 * c->bw < m->my)
317 *y = sy; 318 *y = m->my;
318 if(*h < bh) 319 if(*h < bh)
319 *h = bh; 320 *h = bh;
320 if(*w < bh) 321 if(*w < bh)
@@ -1429,8 +1430,6 @@ setup(void) {
1429 screen = DefaultScreen(dpy); 1430 screen = DefaultScreen(dpy);
1430 root = RootWindow(dpy, screen); 1431 root = RootWindow(dpy, screen);
1431 initfont(font); 1432 initfont(font);
1432 sx = 0;
1433 sy = 0;
1434 sw = DisplayWidth(dpy, screen); 1433 sw = DisplayWidth(dpy, screen);
1435 sh = DisplayHeight(dpy, screen); 1434 sh = DisplayHeight(dpy, screen);
1436 bh = dc.h = dc.font.height + 2; 1435 bh = dc.h = dc.font.height + 2;
@@ -1735,8 +1734,8 @@ updategeom(void) {
1735 /* default monitor setup */ 1734 /* default monitor setup */
1736 { 1735 {
1737 m->screen_number = 0; 1736 m->screen_number = 0;
1738 m->wx = sx; 1737 m->wx = 0;
1739 m->my = m->wy = sy; 1738 m->my = m->wy = 0;
1740 m->ww = sw; 1739 m->ww = sw;
1741 m->mh = m->wh = sh; 1740 m->mh = m->wh = sh;
1742 } 1741 }