This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is Cygwin X server causing ubuntu eclipse to copy to the clipboard on selection?


On 23/06/2012 00:33, David Karr wrote:
> I run Eclipse on win7, and also Eclipse on Ubuntu, displaying the
> window on my Win7 box, using Cygwin.
> 
> One annoyance I have with the latter is that when I select a region of
> text, it appears to automatically copy that region to the clipboard,
> instead of waiting for me to press Ctrl-C.
> 
> I asked about this on the eclipse forums, and they said Ubuntu Eclipse
> doesn't do this, and it's likely being done by my X server.

Yes, the X server is copying the selected text to the Windows clipboard.

Let me try to explain why:

X supports an arbitrary number of 'selections', the two of interest here are
the PRIMARY selection (which conventionally contains some data which the user
has selected) and the CLIPBOARD selection (which conventionally contains some
data that the user has explicitly requested to be 'copied' to the clipboard)

The Cygwin X server monitors these selections for changes, and makes text in
the most recently changed one available for pasting from the Windows clipboard.

So, if you select some text in eclipse after copying some text to the
clipboard, you will get the selected text, not the copied text, when you paste
in Windows.

I can understand this behaviour is confusing to people who are expecting the X
clipboard to behave like the Windows one.

It has been suggested a few times that we should not monitor the PRIMARY
selection, but some very popular X applications (such as xterm and emacs) only
use the PRIMARY selection by default.  It's also been suggested that
monitoring the PRIMARY selection should be configurable somehow, but I'm not
sure that a global configuration option would lead to very useful behaviour.

As always, patches welcome :-)

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]