Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
d343f5847b | |||
55c8d82eb1 | |||
d679267c46 | |||
bdd3246271 |
@ -1,5 +1,5 @@
|
|||||||
# st version
|
# st version
|
||||||
VERSION = 0.0
|
VERSION = 0.1.1
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
10
st.c
10
st.c
@ -392,8 +392,8 @@ getbuttoninfo(XEvent *e, int *b, int *x, int *y) {
|
|||||||
if(b)
|
if(b)
|
||||||
*b = e->xbutton.button;
|
*b = e->xbutton.button;
|
||||||
|
|
||||||
*x = e->xbutton.x/xw.cw;
|
*x = (e->xbutton.x - BORDER)/xw.cw;
|
||||||
*y = e->xbutton.y/xw.ch;
|
*y = (e->xbutton.y - BORDER)/xw.ch;
|
||||||
sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex;
|
sel.b.x = sel.by < sel.ey ? sel.bx : sel.ex;
|
||||||
sel.b.y = MIN(sel.by, sel.ey);
|
sel.b.y = MIN(sel.by, sel.ey);
|
||||||
sel.e.x = sel.by < sel.ey ? sel.ex : sel.bx;
|
sel.e.x = sel.by < sel.ey ? sel.ex : sel.bx;
|
||||||
@ -403,8 +403,8 @@ getbuttoninfo(XEvent *e, int *b, int *x, int *y) {
|
|||||||
void
|
void
|
||||||
bpress(XEvent *e) {
|
bpress(XEvent *e) {
|
||||||
sel.mode = 1;
|
sel.mode = 1;
|
||||||
sel.ex = sel.bx = e->xbutton.x/xw.cw;
|
sel.ex = sel.bx = (e->xbutton.x - BORDER)/xw.cw;
|
||||||
sel.ey = sel.by = e->xbutton.y/xw.ch;
|
sel.ey = sel.by = (e->xbutton.y - BORDER)/xw.ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -483,7 +483,7 @@ selrequest(XEvent *e) {
|
|||||||
XA_ATOM, 32, PropModeReplace,
|
XA_ATOM, 32, PropModeReplace,
|
||||||
(unsigned char *) &string, 1);
|
(unsigned char *) &string, 1);
|
||||||
xev.property = xsre->property;
|
xev.property = xsre->property;
|
||||||
} else if(xsre->target == XA_STRING) {
|
} else if(xsre->target == sel.xtarget) {
|
||||||
XChangeProperty(xsre->display, xsre->requestor, xsre->property,
|
XChangeProperty(xsre->display, xsre->requestor, xsre->property,
|
||||||
xsre->target, 8, PropModeReplace,
|
xsre->target, 8, PropModeReplace,
|
||||||
(unsigned char *) sel.clip, strlen(sel.clip));
|
(unsigned char *) sel.clip, strlen(sel.clip));
|
||||||
|
Reference in New Issue
Block a user