views:

130

answers:

1

I am developing a GTK based application which has to support clipboard. For that I am exporting selection data using gtk_clipboard_set_with_data with the target formats: UTF8_STRING, STRING, TEXT, COMPOUND_TEXT, text/plain, text/plain;charset=utf-8, text/rtf, text/html and text/url. Using this I am able to copy-paste text from my aplication to other text editors like gedit. However, I am not able to paste text to XTerm. Should I be exporting to any other target? Where can I get a list of formats accepted by XTerm?

+2  A: 

xterm only uses the PRIMARY selection buffer, so you should probably add that to your list.

See http://www.davidsimmons.com/soft/xtermhacks/#copynpaste and http://www.freedesktop.org/wiki/Specifications/ClipboardsWiki for more information.

schot
Does this mean that all other application (e.g., firefox) from which I can copy-paste to xterm use both `PRIMARY` and `CLIPBOARD` buffers? Will there be any side effects if I use both `PRIMARY` and `CLIPBOARD` buffers simultaneously? What I understood is that even if I use `PRIMARY` on Ctrl-C, it will be overwritten if user selects some text before pasting on XTerm.
Rajorshi
Yes, I believe you are right. But xterm users should be used to that, since that is the only way to copy-paste with this archaic program (I use it myself).
schot
What about Gnome Terminals then? They support copy-paste. That means they use `CLIPBOARD`, right? But I can't paste to them either. Sorry for coming up with so many questions. Just don't know where else to turn.
Rajorshi
Don't know about Gnome Terminal but apparently is suffered from the same problem: http://cafbit.com/entry/gnome_terminal_friendly_clipboard_patch
schot