Hello list,

I know this isn't a democracy, but I agree with Greg, it makes more
sense to only set PRIMARY, not CLIPBOARD, in selcopy. Removing the
clipboard-related lines from xsetsel seems to do the trick. I've
attached a patch that does just that.

Cheers,
Wander

On Thu, Feb 19, 2015 at 10:30 PM, Greg Reagle <greg.rea...@umbc.edu> wrote:
> When I select text in st using the mouse, it sets both the primary
> selection and the clipboard selection.  It should only set the primary
> selection.  The clipboard is supposed to be only for explicitly
> requested copying.
>
> From
> http://standards.freedesktop.org/clipboards-spec/clipboards-latest.txt:
>
> Application authors should follow the following guidelines to get
> correct behavior:
>
>  - selecting but with no explicit copy should only set PRIMARY,
>    never CLIPBOARD
>
> --
> http://www.fastmail.com - IMAP accessible web-mail
>
>
From 7552a9358aecd38006cdbcff61491ae8e713aa13 Mon Sep 17 00:00:00 2001
From: Wander Nauta <i...@wandernauta.nl>
Date: Fri, 20 Feb 2015 00:36:48 +0100
Subject: [PATCH] Don't clobber CLIPBOARD

---
 st.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/st.c b/st.c
index b9d30a7..5af4dc2 100644
--- a/st.c
+++ b/st.c
@@ -1080,16 +1080,9 @@ selrequest(XEvent *e) {
 
 void
 xsetsel(char *str) {
-	/* register the selection for both the clipboard and the primary */
-	Atom clipboard;
-
 	free(sel.clip);
 	sel.clip = str;
-
 	XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, CurrentTime);
-
-	clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
-	XSetSelectionOwner(xw.dpy, clipboard, xw.win, CurrentTime);
 }
 
 void
-- 
2.3.0

Reply via email to