Move X-specific selection info into XSelection
[st.git] / st.c
diff --git a/st.c b/st.c
index dae7b91..ea0726c 100644 (file)
--- a/st.c
+++ b/st.c
@@ -365,13 +365,9 @@ base64dec(const char *src)
 void
 selinit(void)
 {
-       clock_gettime(CLOCK_MONOTONIC, &sel.tclick1);
-       clock_gettime(CLOCK_MONOTONIC, &sel.tclick2);
        sel.mode = SEL_IDLE;
        sel.snap = 0;
        sel.ob.x = -1;
-       sel.primary = NULL;
-       sel.clipboard = NULL;
 }
 
 int
@@ -419,7 +415,8 @@ selnormalize(void)
 int
 selected(int x, int y)
 {
-       if (sel.mode == SEL_EMPTY)
+       if (sel.mode == SEL_EMPTY || sel.ob.x == -1 ||
+                       sel.alt != IS_SET(MODE_ALTSCREEN))
                return 0;
 
        if (sel.type == SEL_RECTANGULAR)