X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=3eb66fa92ca1df7b593437f3a6e9a14b13adbb5c;hb=c990abfedf56cb8d3176fe6d5152ff65bb68bff0;hp=cf6556a2168c50cd0c15def4fc55c4a82b58b1f1;hpb=3cb7f27afe89c33c74b51c5460b7fb16413f786b;p=st.git diff --git a/st.c b/st.c index cf6556a..3eb66fa 100644 --- a/st.c +++ b/st.c @@ -716,6 +716,9 @@ selnormalize(void) { bool selected(int x, int y) { + if(sel.mode == SEL_EMPTY) + return false; + if(sel.type == SEL_RECTANGULAR) return BETWEEN(y, sel.nb.y, sel.ne.y) && BETWEEN(x, sel.nb.x, sel.ne.x); @@ -921,14 +924,9 @@ bpress(XEvent *e) { } selnormalize(); - /* - * Draw selection, unless it's regular and we don't want to - * make clicks visible - */ - if(sel.snap != 0) { + if(sel.snap != 0) sel.mode = SEL_READY; - tsetdirt(sel.nb.y, sel.ne.y); - } + tsetdirt(sel.nb.y, sel.ne.y); sel.tclick2 = sel.tclick1; sel.tclick1 = now; }