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 | 3a50a4fd931ed58454b680c9fc5c1bc2278e67f3 (patch) | |
| tree | da6ea67d14f4f3d0bf3b29dbdd14fbbb36f3ddda /st.c | |
| parent | compose key patch. thx federico luna. (diff) | |
| download | st-3a50a4fd931ed58454b680c9fc5c1bc2278e67f3.tar.gz st-3a50a4fd931ed58454b680c9fc5c1bc2278e67f3.zip | |
clean button selection code.
Diffstat (limited to '')
| -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) { | |||
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | static void getbuttoninfo(XEvent *e, int *b, int *x, int *y) { | 245 | static void getbuttoninfo(XEvent *e, int *b, int *x, int *y) { |
| 246 | if(b) *b = e->xbutton.state, | 246 | if(b) |
| 247 | *b=*b==4096?5:*b==2048?4:*b==1024?3:*b==512?2:*b==256?1:-1; | 247 | *b = e->xbutton.button; |
| 248 | |||
| 248 | *x = e->xbutton.x/xw.cw; | 249 | *x = e->xbutton.x/xw.cw; |
| 249 | *y = e->xbutton.y/xw.ch; | 250 | *y = e->xbutton.y/xw.ch; |
| 250 | sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex; | 251 | sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex; |
