From a34d1bc583e1b5293a31d5960a565f39f1369220 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 5 Jan 2008 12:01:09 +0100 Subject: [PATCH] fix comparisons --- event.c | 6 +++--- widgets/taglist.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/event.c b/event.c index 223eaaf10..cbf5f690c 100644 --- a/event.c +++ b/event.c @@ -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; diff --git a/widgets/taglist.c b/widgets/taglist.c index 166cf58b4..c7d3b5e5f 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -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);