On Aug 9, 2007, at 2:45 PM, Rich Cook wrote: If you ask me, this is all a pretty good bug report -- the question is, will someone from Apple pipe up and say "we're working on it, guys, give it a rest?" :-)
Yes! :D
The discussion here has been good, and pretty much matches up with my understanding of the problem.
If I had to guess, I'd say that part of the problem that X11 and OS X use (almost) opposite systems for cut and paste!
In another message, Vincent referenced these two excellent links:
I would like to add this one to the discussion:
My suspicion is that quartz-wm, the part that manages copy / paste, translates a "copy" command from X11 to a "promise" for the NSPasteBoard. When the native Aqua app then goes and asks for the clipboard, quartz-wm gets the "promise", copies PRIMARY to CLIPBOARD, and then sends PRIMARY to the NSPasteBoard, or CLIPBOARD if PRIMARY is empty.
The problem here, of course, is that if nothing has requested the contents of the PasteBoard before you kill the PRIMARY selection, then CLIPBOARD says empty, and the transfer fails. Running "xclipboard" in the background seems to "solve" the problem by repeatedly asking for the contents of CLIPBOARD, which transfers the copy of PRIMARY over to CLIPBOARD before you have a chance to kill the selection.
There are two big problems with this theory: 1. Looking at the code for quartz-wm, it seems like it already tries to do this 2. For some people, it seems to work just fine.
Another complicating factor is that the whole X11 copy / paste setup is a mess, which tends to confuse the issue and make it hard to predict what *should* happen. I am working with the X.org leadership to try to clean this up.
BTW, here's my test case for demonstrating this failure:
1. Select some text in xterm, hit ⌘-C to copy, click in Terminal.app to activate it, hit ⌘-V to paste. Result: Hilighted text from xterm is pasted into Terminal, as expected.
2. Select some text in xterm; hit ⌘-C to copy. Click again in xterm to clear the primary selection. Click in Terminal to activate, hit ⌘-V to paste. Result: No text is pasted.
3. Run xclipboard; leave it running in background. Select some text in xterm; hit ⌘-C to copy. Click again in xterm to clear the primary selection. Click in Terminal to activate, hit ⌘-V to paste. Result: Text is successfully pasted, as in #1.
When you report bugs, it's super helpful if you can come up with a simple, unambiguous set of steps to follow, as with the above.
My hunch is that the real problem lies in the interaction between a number of different parts of OS X, which makes it hard to track down.
Ben
|