Re: copy and paste between Aqua and X11 applications?
Re: copy and paste between Aqua and X11 applications?
- Subject: Re: copy and paste between Aqua and X11 applications?
- From: Vernon Williams <email@hidden>
- Date: Thu, 9 Aug 2007 14:18:00 -0500
Thursday, August 9, 2007, 1:40pm
For the record, here is the X11 version info for my 2 Macs
(I am just using what they came with, have not downloaded
any newer versions):
on dual processor PowerPc G5 under OS X 10.3.9:
X11 1.0 - XFree86 4.3.0
(c) 2003, Apple Computer, Inc.
(c) 2003, XFree36 Project, Inc.
on Intel Core Duo MacBook Pro 15" under OS X 10.4.6:
X11 1.1 - XFree86 4.4.0
(c) 2003-2004, Apple Computer, Inc.
(c) 1994-2004, XFree86 Project, Inc.
For the exact sequence of events I use to get for a failure,
first bring both up a Terminal and an xterm, side by side.
Then select some text in the xterm with the mouse.
Then either type Cmd-C from the keyboard, or click
on Copy in the X11 Edit menu.
(I do not have Focus Follows Mouse turned on, by the
way, so I have to click on a window to get focus.)
Then click somewhere in the xterm to remove the selection.
Then click on the Terminal for focus.
Then type Cmd-V from the keyboard, or click on Paste in
the Terminal Edit menu.
At this point, nothing will be pasted, and Terminal will beep.
As I said earlier, though, if you paste at least once before
deselecting the text, you can paste the text as much as you
want.
From a programming standpoint, what this looks like is a
pointer issue. Here is what it looks like it must be doing
to me (without having any access to Apple's code):
The Aqua clipboard seems to consist of a pointer to a
(presumably null terminated) string of text, along with
some sort of flag variable indicating the source of the
text (X11 or Aqua, say).
After a copy, X11 would appear to be setting the pointer
to the selection and the source to X11.
Then when Aqua wants to paste, it sees the X11 flag is
set, allocates space for the string, copies the selection
to the newly allocated space, sets the clipboard pointer
to the new space, and resets the flag to Aqua.
But if you deselect the text before the first paste, the
selection disappears, and the pointer probably points
to nothing.
Or maybe it using handles, and the pointer is nulled out,
still leaving nothing to paste.
If this is the case, then what Apple really needs to do in
their X11 is to allocate new space and copy the selection
to it whenever X11 does a copy, then change the Aqua
clipboard pointer to point to the new space rather than
to the selection buffer.
Vernon Williams
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden