From dcdbd06e56d3df505e9c217e679d706bac70849e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 11 Nov 2007 22:56:59 +0100 Subject: [PATCH] handle mouse button event on statusbar if position is right/left --- event.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/event.c b/event.c index 7544b9adf..17713698d 100644 --- a/event.c +++ b/event.c @@ -173,7 +173,11 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) for(i = 0; i < awesomeconf[screen].ntags; i++) { x += textwidth(e->xany.display, awesomeconf[screen].font, awesomeconf[screen].tags[i].name); - if(ev->x < x) + if(((awesomeconf[screen].statusbar.position == BarTop + || awesomeconf[screen].statusbar.position == BarBot) + && ev->x < x) + || (awesomeconf[screen].statusbar.position == BarRight && ev->y < x) + || (awesomeconf[screen].statusbar.position == BarLeft && ev->y > awesomeconf[screen].statusbar.width - x)) { snprintf(arg, sizeof(arg), "%d", i + 1); handle_mouse_button_press(&awesomeconf[screen], @@ -183,7 +187,11 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) } } x += awesomeconf[screen].statusbar.txtlayoutwidth; - if(ev->x x < x) + || (awesomeconf[screen].statusbar.position == BarRight && ev->y < x) + || (awesomeconf[screen].statusbar.position == BarLeft && ev->y > awesomeconf[screen].statusbar.width - x)) handle_mouse_button_press(&awesomeconf[screen], ev->button, ev->state, awesomeconf->numlockmask, awesomeconf->buttons.layout, awesomeconf->buttons.nlayout, NULL);