aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2010-10-13 00:50:18 +0200
committerAurélien Aptel <aurelien.aptel@gmail.com>2010-10-13 00:50:18 +0200
commit3a50a4fd931ed58454b680c9fc5c1bc2278e67f3 (patch)
treeda6ea67d14f4f3d0bf3b29dbdd14fbbb36f3ddda
parent3470e3af23f4b98ce4293f6090c8df59a08329d9 (diff)
downloadst-3a50a4fd931ed58454b680c9fc5c1bc2278e67f3.tar.gz
st-3a50a4fd931ed58454b680c9fc5c1bc2278e67f3.tar.bz2
clean button selection code.
-rw-r--r--st.c5
1 files changed, 3 insertions, 2 deletions
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;