X11 Clipboard implementation

Mike Hearn m.hearn at signal.qinetiq.com
Wed Feb 12 04:22:33 CST 2003

Hi all,

I've been poking around inside the wine clipboard system, in an attempt
to make it properly compliant with the agreed upon specs over at 


At the moment, Wine mixes up CLIPBOARD and PRIMARY, which is not a good
idea. Ideally, Wine would work like GTK, Qt, Mozilla and all the rest
do, which is to keep CLIPBOARD for ctrl-c, ctrl-v type operations, and
primary for selected text/middle click.

When you select some text in say notepad, both CLIPBOARD and PRIMARY are
grabbed, which is wrong, only primary should be grabbed. In a similar
fashion, when you select Edit | Copy only CLIPBOARD should be grabbed.

Currently, selecting text in Wine doesn't do anything (at least, not in
notepad). So, the obvious way to fix that would be to introduce a new
Wine-specific API, that lets the Wine controls call SetSelectedText or
something, which then interfaces with X.

So, I think x11drv/clipboard.c should be changed to basically eliminate
references to PRIMARY, as without the ability to deal with middle clicks
and grab-on-select, Wine has no business changing that selection.

Therefore my questions are:

1) Should I try and hack up a patch to stop wine using PRIMARY?
2) What are the rules governing new wine specific APIs. I know the DLL
Separation work is supposed to eliminate them, but there are no FAQs
anywhere on it that I can see, could somebody explain this please?

thanks -mike

Mike Hearn <m.hearn at signal.qinetiq.com>
QinetiQ - Malvern Technology Center

More information about the wine-devel mailing list