commit f1a6e75d10fe2fea4202b275e757c6731d8fe64a
parent ff4fc9cee749084594914252b6b83a9c1456e39c
Author: Kris Maglione <kris@suckless.org>
Date: Fri, 11 Jun 2010 23:46:35 -0400
Treat 1px from the right/bottom edge of the screen as the edge. Closes issue #161.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/cmd/wmii/mouse.c b/cmd/wmii/mouse.c
@@ -187,6 +187,7 @@ readmouse(Point *p, uint *button) {
for(;;) {
XMaskEvent(display, MouseMask|ExposureMask|PropertyChangeMask, &ev);
+ debug_event(&ev);
switch(ev.type) {
case Expose:
case NoExpose:
@@ -201,6 +202,10 @@ readmouse(Point *p, uint *button) {
case MotionNotify:
p->x = ev.xmotion.x_root;
p->y = ev.xmotion.y_root;
+ if(p->x == scr.rect.max.x - 1)
+ p->x = scr.rect.max.x;
+ if(p->y == scr.rect.max.x - 1)
+ p->y = scr.rect.max.x;
break;
}
return ev.type;