diff options
author | okan | 2015-11-09 20:03:29 +0000 |
---|---|---|
committer | okan | 2015-11-09 20:03:29 +0000 |
commit | cce06135af44660039026ea785a5ffdbfc277ea9 (patch) | |
tree | 428deb257ef67f9fa4e88add56ad0009f3da6ddf /mousefunc.c | |
parent | 337fd02962f9d55347c18b20876f44d2600787ee (diff) | |
download | cwm-cce06135af44660039026ea785a5ffdbfc277ea9.tar.gz |
Extend region to include both view and work areas; switch to
region_find() which no longer needs to recalculate gap each time
a client (or menu) is created or altered. If no RandR, fall back
to display dimensions while building regions instead of during
execution.
Diffstat (limited to '')
-rw-r--r-- | mousefunc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mousefunc.c b/mousefunc.c index d429a5d..3edb47a 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: mousefunc.c,v 1.98 2015/08/21 16:14:39 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.99 2015/11/09 20:03:30 okan Exp $ */ #include <sys/types.h> @@ -123,7 +123,7 @@ mousefunc_client_move(struct client_ctx *cc, union arg *arg) XEvent ev; Time ltime = 0; struct screen_ctx *sc = cc->sc; - struct geom area; + struct region_ctx *rc; int px, py; client_raise(cc); @@ -149,15 +149,15 @@ mousefunc_client_move(struct client_ctx *cc, union arg *arg) cc->geom.x = ev.xmotion.x_root - px - cc->bwidth; cc->geom.y = ev.xmotion.y_root - py - cc->bwidth; - area = screen_area(sc, + rc = region_find(sc, cc->geom.x + cc->geom.w / 2, - cc->geom.y + cc->geom.h / 2, CWM_GAP); + cc->geom.y + cc->geom.h / 2); cc->geom.x += client_snapcalc(cc->geom.x, cc->geom.x + cc->geom.w + (cc->bwidth * 2), - area.x, area.x + area.w, sc->snapdist); + rc->work.x, rc->work.x + rc->work.w, sc->snapdist); cc->geom.y += client_snapcalc(cc->geom.y, cc->geom.y + cc->geom.h + (cc->bwidth * 2), - area.y, area.y + area.h, sc->snapdist); + rc->work.y, rc->work.y + rc->work.h, sc->snapdist); client_move(cc); break; |