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?
views:
130answers:
1
+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
2010-07-22 07:33:45
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
2010-07-22 07:51:19
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
2010-07-22 07:54:26
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
2010-07-22 08:03:43
Don't know about Gnome Terminal but apparently is suffered from the same problem: http://cafbit.com/entry/gnome_terminal_friendly_clipboard_patch
schot
2010-07-22 08:17:33