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: robert delius royar <email@hidden>
- Date: Sat, 5 Jun 2004 12:47:53 -0400 (EDT)
- Organization: An Apple OS X end user
- Priority: NEW
On Sat, 5 Jun 2004 about 19:23 +1000 UTC Shuying Wang wrote:
> On Sat, Jun 05, 2004 at 08:42:36AM +0000, Michael Abbott wrote:
> > On Fri, 4 Jun 2004, Eugene Lee wrote:
> > > On Fri, Jun 04, 2004 at 10:16:26AM +1000, Shuying Wang wrote:
> > > : Could someone tell me how copy and paste between Aqua and X11
> > > : applications work?
> > > You can copy/paste text by selecting Edit->Copy / Edit->Paste in the
> > > X11.app global menu item, which basically let's the user manually copy
> > > clipboard data between the Aqua and X11 environments.
> > This works *some* of the time, but not reliably.
> > This has been a problem in all versions of X11, and I see nothing to
> > suggest that Apple have the slightest interest in addressing it (the last
> > update to X11 seems to have been back in October).
>
> Yes. I'm trying to understand how copy and paste works programmatically. I had
> a look at the developers documentation on the Apple website and it
> explains the clipboard interface between Cocoa/Carbon programs but it makes
> no mention of how it works between native GUI apps and X11 apps.
I can copy/paste consistently between the two interfaces (except for certain
programs such as Mozilla and XEmacs that maintain their own clipboards and
cutbuffers). But I had to cobble together my own fix. Look at the source
for X11 xclipboard xcutsel for some idea of how this works. Also look for a
utility (not in the X11 tarball) named xcb.
Finally, look for source to a third-party application named "clipboard" at
http://itp.stanford.edu/~zunger/clipboard_source.tgz or the Apple
applications pbcopy and pbpaste which allow terminal applications to access
the Pasteboard. I use a self-modified xcb and the clipboard program with a
script (below) to force a copy between the two systems when otherwise things
do not work. Basically, I modified xcb to add some commands to call the
script when needed. But I rarely have to use that function. I do sometimes
have to make sure that xclipboard displays the current X cut buffer. I
never have trouble getting the Aqua Pasteboard into X. Except as state
before when a program such as Mozilla has hijacked the system's idea of that
buffer. You might notice that some Aqua programs have different ideas of
Command-C buffers, Right-Click-Menu Buffers, and Edit->Copy buffers.
Carbonized Mozilla certainly does.
#!/bin/sh
# copies X11 CUT_BUFFER to OS X Clipboard
if [ $# -gt 1 ]; then
Buffer=$1
else
Buffer=0
fi
/usr/local/bin/clipboard | /usr/X11R6/bin/xcb -s ${Buffer}
--
Dr. Robert Delius Royar Associate Professor of English
Morehead State University Morehead, Kentucky
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
Do not post admin requests to the list. They will be ignored.