Treat 1px from the right/bottom edge of the screen as the edge. Closes issue #161.

This commit is contained in:
Kris Maglione 2010-06-11 23:46:35 -04:00
parent ff4fc9cee7
commit f1a6e75d10

View File

@ -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;