diff options
author | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2009-02-27 01:47:33 +0000 |
---|---|---|
committer | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2009-02-27 01:47:33 +0000 |
commit | 2bac4f00ed028c8a3f33e4a06c55a88da5019e11 (patch) | |
tree | 433f76a5063ec98cef54c8a59024170d8419800f /main.c | |
parent | b44d790dbbab8c80c238f70d7dbeef44880342cc (diff) | |
download | dzen-2bac4f00ed028c8a3f33e4a06c55a88da5019e11.tar.gz dzen-2bac4f00ed028c8a3f33e4a06c55a88da5019e11.zip |
applied patch from Philip Lewis:
* refactored out big block of duplicated code in
draw.c:parse_line()
* y tracking for clickable areas
* fixed bug where having position locked at end of line could screw
up autoresize
* "block align" formatting command: ^ba(width,align)
* added optional arguments to menuprint actions
git-svn-id: http://dzen.googlecode.com/svn/trunk@255 f2baff5b-bf2c-0410-a398-912abdc3d8b2
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 54 |
1 files changed, 29 insertions, 25 deletions
@@ -599,7 +599,7 @@ x_redraw(Window w) { static void handle_xev(void) { XEvent ev; - int i; + int i, sa_clicked=0; char buf[32]; KeySym ksym; @@ -646,34 +646,38 @@ handle_xev(void) { if(ev.xbutton.window == dzen.title_win.win && ev.xbutton.button == sens_areas[i].button && (ev.xbutton.x >= sens_areas[i].start_x+xorig && - ev.xbutton.x <= sens_areas[i].end_x+xorig)) { + ev.xbutton.x <= sens_areas[i].end_x+xorig) && + (ev.xbutton.y >= sens_areas[i].start_y && + ev.xbutton.y <= sens_areas[i].end_y)) { spawn(sens_areas[i].cmd); + sa_clicked++; break; } } - - switch(ev.xbutton.button) { - case Button1: - do_action(button1); - break; - case Button2: - do_action(button2); - break; - case Button3: - do_action(button3); - break; - case Button4: - do_action(button4); - break; - case Button5: - do_action(button5); - break; - case Button6: - do_action(button6); - break; - case Button7: - do_action(button7); - break; + if(!sa_clicked) { + switch(ev.xbutton.button) { + case Button1: + do_action(button1); + break; + case Button2: + do_action(button2); + break; + case Button3: + do_action(button3); + break; + case Button4: + do_action(button4); + break; + case Button5: + do_action(button5); + break; + case Button6: + do_action(button6); + break; + case Button7: + do_action(button7); + break; + } } break; case KeyPress: |