aboutsummaryrefslogtreecommitdiffstats
path: root/mousefunc.c
diff options
context:
space:
mode:
authorokan2015-11-11 14:22:01 +0000
committerokan2015-11-11 14:22:01 +0000
commitf6f5e0fe9eb0a0ce66ee5d0720182bfadf2cf800 (patch)
tree55799ebc2fe2f87b956e1440a0b2ce413bbffe64 /mousefunc.c
parent29e76eaac34fcdbc70eaccb72c3f68b638a4c5b2 (diff)
downloadcwm-f6f5e0fe9eb0a0ce66ee5d0720182bfadf2cf800.tar.gz
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 '')
-rw-r--r--mousefunc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mousefunc.c b/mousefunc.c
index a0d1813..4cb2e30 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.101 2015/11/10 22:06:57 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.102 2015/11/11 14:22:01 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 region_ctx *rc;
+ struct geom area;
int px, py;
client_raise(cc);
@@ -149,14 +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;
- rc = region_find(sc,
- ev.xmotion.x_root, ev.xmotion.y_root);
+ 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);
break;