summaryrefslogtreecommitdiff
path: root/app/cwm/kbfunc.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2015-11-11 14:22:02 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2015-11-11 14:22:02 +0000
commit064fa01f56e31e3c20d0a09a7cbd458a6e0183ce (patch)
treefcf8ed428bbc9c36c6640aa4502e77cb2a40a9e1 /app/cwm/kbfunc.c
parent6e4d6b085f79615d849ac609782392cb02b8cd4b (diff)
Partial revert of replacing screen_area() with region_find(); until a
fix for a regression is found; this bug has been around for a long time it seems, but this change exposed it. Likely need to track clients in to and out of regions.
Diffstat (limited to 'app/cwm/kbfunc.c')
-rw-r--r--app/cwm/kbfunc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c
index 2b402c937..2a180e244 100644
--- a/app/cwm/kbfunc.c
+++ b/app/cwm/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.121 2015/11/10 22:06:57 okan Exp $
+ * $OpenBSD: kbfunc.c,v 1.122 2015/11/11 14:22:01 okan Exp $
*/
#include <sys/types.h>
@@ -57,7 +57,7 @@ void
kbfunc_client_moveresize(struct client_ctx *cc, union arg *arg)
{
struct screen_ctx *sc = cc->sc;
- struct region_ctx *rc;
+ struct geom area;
int x, y, flags, amt;
unsigned int mx, my;
@@ -101,14 +101,15 @@ 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;
- xu_ptr_getpos(cc->win, &x, &y);
- rc = region_find(sc, x + 1, y + 1);
+ area = screen_area(sc,
+ cc->geom.x + cc->geom.w / 2,
+ cc->geom.y + cc->geom.h / 2, CWM_GAP);
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);
+ area.x, area.x + area.w, sc->snapdist);
cc->geom.y += client_snapcalc(cc->geom.y,
cc->geom.y + cc->geom.h + (cc->bwidth * 2),
- rc->work.y, rc->work.y + rc->work.h, sc->snapdist);
+ area.y, area.y + area.h, sc->snapdist);
client_move(cc);
xu_ptr_getpos(cc->win, &x, &y);