fix comparisons

This commit is contained in:
Julien Danjou 2008-01-05 12:01:09 +01:00
parent 3018282169
commit a34d1bc583
2 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ handle_event_buttonpress(XEvent *e)
case Top:
case Bottom:
for(widget = statusbar->widgets; widget; widget = widget->next)
if(ev->x >= widget->area.x && ev->x <= widget->area.x + widget->area.width)
if(ev->x >= widget->area.x && ev->x < widget->area.x + widget->area.width)
{
widget->button_press(widget, ev);
return;
@ -84,7 +84,7 @@ handle_event_buttonpress(XEvent *e)
break;
case Right:
for(widget = statusbar->widgets; widget; widget = widget->next)
if(ev->y >= widget->area.x && ev->y <= widget->area.x + widget->area.width)
if(ev->y >= widget->area.x && ev->y < widget->area.x + widget->area.width)
{
widget->button_press(widget, ev);
return;
@ -93,7 +93,7 @@ handle_event_buttonpress(XEvent *e)
default:
for(widget = statusbar->widgets; widget; widget = widget->next)
if(statusbar->width - ev->y >= widget->area.x
&& statusbar->width - ev->y <= widget->area.x + widget->area.width)
&& statusbar->width - ev->y < widget->area.x + widget->area.width)
{
widget->button_press(widget, ev);
return;

View File

@ -132,7 +132,7 @@ taglist_button_press(Widget *widget, XButtonPressedEvent *ev)
{
width = textwidth(vscreen.font, tag->name) + vscreen.font->height;
if(ev->x >= widget->area.x + prev_width
&& ev->x <= widget->area.x + prev_width + width)
&& ev->x < widget->area.x + prev_width + width)
{
snprintf(buf, sizeof(buf), "%d", i);
b->func(widget->statusbar->screen, buf);
@ -146,7 +146,7 @@ taglist_button_press(Widget *widget, XButtonPressedEvent *ev)
{
width = textwidth(vscreen.font, tag->name) + vscreen.font->height;
if(ev->y >= widget->area.x + prev_width
&& ev->y <= widget->area.x + prev_width + width)
&& ev->y < widget->area.x + prev_width + width)
{
snprintf(buf, sizeof(buf), "%d", i);
b->func(widget->statusbar->screen, buf);
@ -160,7 +160,7 @@ taglist_button_press(Widget *widget, XButtonPressedEvent *ev)
{
width = textwidth(vscreen.font, tag->name) + vscreen.font->height;
if(widget->statusbar->width - ev->y >= widget->area.x + prev_width
&& widget->statusbar->width - ev->y <= widget->area.x + prev_width + width)
&& widget->statusbar->width - ev->y < widget->area.x + prev_width + width)
{
snprintf(buf, sizeof(buf), "%d", i);
b->func(widget->statusbar->screen, buf);