aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2015-11-10 22:06:57 +0000
committerokan2015-11-10 22:06:57 +0000
commit29e76eaac34fcdbc70eaccb72c3f68b638a4c5b2 (patch)
treeee24e6e45184182857e8fb4f26555a3087aabbf8
parent7c8ffa9d8af57ad9db9d8e99a694aebfa76ea11a (diff)
downloadcwm-29e76eaac34fcdbc70eaccb72c3f68b638a4c5b2.tar.gz
Use position on root to figure out region.
Diffstat (limited to '')
-rw-r--r--kbfunc.c7
-rw-r--r--mousefunc.c5
2 files changed, 5 insertions, 7 deletions
diff --git a/kbfunc.c b/kbfunc.c
index 537d8e0..2b402c9 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: kbfunc.c,v 1.120 2015/11/10 20:05:33 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.121 2015/11/10 22:06:57 okan Exp $
*/
#include <sys/types.h>
@@ -101,9 +101,8 @@ kbfunc_client_moveresize(struct client_ctx *cc, union arg *arg)
if (cc->geom.y > sc->view.h - 1)
cc->geom.y = sc->view.h - 1;
- rc = region_find(sc,
- cc->geom.x + cc->geom.w / 2,
- cc->geom.y + cc->geom.h / 2);
+ xu_ptr_getpos(cc->win, &x, &y);
+ rc = region_find(sc, x + 1, y + 1);
cc->geom.x += client_snapcalc(cc->geom.x,
cc->geom.x + cc->geom.w + (cc->bwidth * 2),
rc->work.x, rc->work.x + rc->work.w, sc->snapdist);
diff --git a/mousefunc.c b/mousefunc.c
index 929fc8d..a0d1813 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.100 2015/11/10 20:05:33 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.101 2015/11/10 22:06:57 okan Exp $
*/
#include <sys/types.h>
@@ -150,8 +150,7 @@ mousefunc_client_move(struct client_ctx *cc, union arg *arg)
cc->geom.y = ev.xmotion.y_root - py - cc->bwidth;
rc = region_find(sc,
- cc->geom.x + cc->geom.w / 2,
- cc->geom.y + cc->geom.h / 2);
+ ev.xmotion.x_root, ev.xmotion.y_root);
cc->geom.x += client_snapcalc(cc->geom.x,
cc->geom.x + cc->geom.w + (cc->bwidth * 2),
rc->work.x, rc->work.x + rc->work.w, sc->snapdist);