aboutsummaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-02-20 08:09:26 +0000
committerAnselm R Garbe <garbeam@gmail.com>2008-02-20 08:09:26 +0000
commitca3e847e459e1ba43f45513877d39d50cce7a0c5 (patch)
treef4f6de94d212b529b83aa547b7ce90eaa323a2fe /dwm.c
parentc2737b7b9317743e3430c71bc0a9afcc6b0f70f7 (diff)
downloaddwm-ca3e847e459e1ba43f45513877d39d50cce7a0c5.tar.gz
applied some necessary changes
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/dwm.c b/dwm.c
index 11f2293..0a1ade2 100644
--- a/dwm.c
+++ b/dwm.c
@@ -117,7 +117,6 @@ typedef struct {
} Regs;
typedef struct {
- int monitor;
Window barwin;
int sx, sy, sw, sh, wax, way, wah, waw;
Bool *seltags;
@@ -1164,11 +1163,13 @@ void
movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny;
unsigned int dui;
+ Monitor *m;
Window dummy;
XEvent ev;
ocx = nx = c->x;
ocy = ny = c->y;
+ m = &monitors[c->monitor];
if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
None, cursor[CurMove], CurrentTime) != GrabSuccess)
return;
@@ -1188,7 +1189,6 @@ movemouse(Client *c) {
XSync(dpy, False);
nx = ocx + (ev.xmotion.x - x1);
ny = ocy + (ev.xmotion.y - y1);
- Monitor *m = &monitors[monitorat()];
if(abs(m->wax - nx) < SNAP)
nx = m->wax;
else if(abs((m->wax + m->waw) - (nx + c->w + 2 * c->border)) < SNAP)
@@ -1197,11 +1197,10 @@ movemouse(Client *c) {
ny = m->way;
else if(abs((m->way + m->wah) - (ny + c->h + 2 * c->border)) < SNAP)
ny = m->way + m->wah - c->h - 2 * c->border;
- if((monitors[selmonitor].layout->arrange != floating) && (abs(nx - c->x) > SNAP || abs(ny - c->y) > SNAP))
+ if((m->layout->arrange != floating) && (abs(nx - c->x) > SNAP || abs(ny - c->y) > SNAP))
togglefloating(NULL);
- if((monitors[selmonitor].layout->arrange == floating) || c->isfloating)
+ if((m->layout->arrange == floating) || c->isfloating)
resize(c, nx, ny, c->w, c->h, False);
- memcpy(c->tags, monitors[monitorat()].seltags, sizeof initags);
break;
}
}
@@ -1335,10 +1334,12 @@ void
resizemouse(Client *c) {
int ocx, ocy;
int nw, nh;
+ Monitor *m;
XEvent ev;
ocx = c->x;
ocy = c->y;
+ m = &monitors[c->monitor];
if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
None, cursor[CurResize], CurrentTime) != GrabSuccess)
return;
@@ -1363,9 +1364,9 @@ resizemouse(Client *c) {
nw = 1;
if((nh = ev.xmotion.y - ocy - 2 * c->border + 1) <= 0)
nh = 1;
- if((monitors[selmonitor].layout->arrange != floating) && (abs(nw - c->w) > SNAP || abs(nh - c->h) > SNAP))
+ if((m->layout->arrange != floating) && (abs(nw - c->w) > SNAP || abs(nh - c->h) > SNAP))
togglefloating(NULL);
- if((monitors[selmonitor].layout->arrange == floating) || c->isfloating)
+ if((m->layout->arrange == floating) || c->isfloating)
resize(c, c->x, c->y, nw, nh, True);
break;
}
@@ -1600,8 +1601,6 @@ setup(void) {
/* init geometry */
m = &monitors[i];
- m->monitor = i;
-
if (mcount != 1 && isxinerama) {
m->sx = info[i].x_org;
m->sy = info[i].y_org;
remember that computers suck.