add support for y coords in clics

This commit is contained in:
Julien Danjou 2008-01-05 12:51:40 +01:00
parent b1c62a618f
commit bfab98d1d4
1 changed files with 7 additions and 3 deletions

10
event.c
View File

@ -76,7 +76,8 @@ 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
&& ev->y >= widget->area.y && ev->y < widget->area.y + widget->area.height)
{
widget->button_press(widget, ev);
return;
@ -84,7 +85,9 @@ 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
&& statusbar->height - ev->x >= widget->area.y
&& statusbar->height - ev->x < widget->area.y + widget->area.height)
{
widget->button_press(widget, ev);
return;
@ -93,7 +96,8 @@ 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
&& ev->x >= widget->area.y && ev->x < widget->area.y + widget->area.height)
{
widget->button_press(widget, ev);
return;