From: Aurélien Aptel Date: Tue, 12 Oct 2010 22:50:18 +0000 (+0200) Subject: clean button selection code. X-Git-Tag: 0.1~32 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=a4ee801882e5ed4a82ba016d4a97618dc6439029;p=st.git clean button selection code. --- diff --git a/st.c b/st.c index d1b90ef..5d5ac30 100644 --- a/st.c +++ b/st.c @@ -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;