On Wed, 2003-02-12 at 05:22, Mike Hearn wrote:
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
http://www.freedesktop.org/standards/clipboards.txt
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.
You may be able to hack some of the controls to support text selection but you won't be able to do it for the general case. For example this wouldn't work in Word. So I don't see this working. In fact it could break assumption made by the application. In my opinion, the only way to copy data from a Windows App to X is via control-c/Clipboard API.
In Windows, to copy data you generally need to select the data (Under X this would grab the PRIMARY selection) and then hit control-c (Under X this would grab the CLIPBOARD selection).
In think we should always be grabbing both PRIMARY and CLIPBOARD and releasing them when we loose either (ClearAllSelections=1). This seemed to be the least confusing for many users as well.
I'm in the process of finishing a large clipboard patch for CodeWeavers that should also address the dll separation issues. Hopefully I'll get the patch together soon and post it to the list.
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:
- Should I try and hack up a patch to stop wine using PRIMARY?
- 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