diff options
author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-10-13 00:50:18 +0200 |
---|---|---|
committer | Aurélien Aptel <aurelien.aptel@gmail.com> | 2010-10-13 00:50:18 +0200 |
commit | a4ee801882e5ed4a82ba016d4a97618dc6439029 (patch) | |
tree | da6ea67d14f4f3d0bf3b29dbdd14fbbb36f3ddda | |
parent | 9bbc040ea6147386d3bb506f070998bfef0cb2a1 (diff) | |
download | st-a4ee801882e5ed4a82ba016d4a97618dc6439029.tar.gz st-a4ee801882e5ed4a82ba016d4a97618dc6439029.tar.bz2 |
clean button selection code.
-rw-r--r-- | st.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -243,8 +243,9 @@ static inline int selected(int x, int y) { } static void getbuttoninfo(XEvent *e, int *b, int *x, int *y) { - if(b) *b = e->xbutton.state, - *b=*b==4096?5:*b==2048?4:*b==1024?3:*b==512?2:*b==256?1:-1; + if(b) + *b = e->xbutton.button; + *x = e->xbutton.x/xw.cw; *y = e->xbutton.y/xw.ch; sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex; |