[hackers] [st] clean button selection code. || Aurélien Aptel

From: <hg_AT_suckless.org>
Date: Tue, 12 Oct 2010 22:49:43 +0000 (UTC)

changeset: 150:0d499dcf5e1f
tag: tip
user: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
date: Wed Oct 13 00:50:18 2010 +0200
files: st.c
description:
clean button selection code.

diff -r 96c41df08c94 -r 0d499dcf5e1f st.c
--- a/st.c Tue Sep 21 16:04:13 2010 +0200
+++ b/st.c Wed Oct 13 00:50:18 2010 +0200
@@ -243,8 +243,9 @@
 }
 
 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;
Received on Wed Oct 13 2010 - 00:49:43 CEST

This archive was generated by hypermail 2.2.0 : Wed Oct 13 2010 - 01:00:08 CEST