mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-22 15:25:58 +01:00
clean button selection code.
This commit is contained in:
parent
3470e3af23
commit
3a50a4fd93
1 changed files with 3 additions and 2 deletions
5
st.c
5
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) {
|
static void getbuttoninfo(XEvent *e, int *b, int *x, int *y) {
|
||||||
if(b) *b = e->xbutton.state,
|
if(b)
|
||||||
*b=*b==4096?5:*b==2048?4:*b==1024?3:*b==512?2:*b==256?1:-1;
|
*b = e->xbutton.button;
|
||||||
|
|
||||||
*x = e->xbutton.x/xw.cw;
|
*x = e->xbutton.x/xw.cw;
|
||||||
*y = e->xbutton.y/xw.ch;
|
*y = e->xbutton.y/xw.ch;
|
||||||
sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex;
|
sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex;
|
||||||
|
|
Loading…
Reference in a new issue