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(;;) { for(;;) {
XMaskEvent(display, MouseMask|ExposureMask|PropertyChangeMask, &ev); XMaskEvent(display, MouseMask|ExposureMask|PropertyChangeMask, &ev);
debug_event(&ev);
switch(ev.type) { switch(ev.type) {
case Expose: case Expose:
case NoExpose: case NoExpose:
@ -201,6 +202,10 @@ readmouse(Point *p, uint *button) {
case MotionNotify: case MotionNotify:
p->x = ev.xmotion.x_root; p->x = ev.xmotion.x_root;
p->y = ev.xmotion.y_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; break;
} }
return ev.type; return ev.type;