GNOME Bugzilla – Bug 121590
Patch: Clipboard daemon for gnome-settings-daemon
Last modified: 2007-10-28 20:45:36 UTC
A while ago there has been a discussion about integrating a clipboard daemon in GNOME which keeps the content of the clipboard in memory, so that even if the owner application exits the clipboard will not be lost: http://mail.gnome.org/archives/desktop-devel-list/2003-June/msg00422.html Here's a patch for gnome-settings-daemon (against most recent anonymous CVS) which does exactly that. No configuration options - it's supposed to Just Work(tm). I've tested this extensively for several weeks and it works fine (including QT and Mozilla apps, and apps that copy & paste richtext like AbiWord). This patch can also be applied against the latest stable release of control-center.
Created attachment 19780 [details] [review] The patch
Created attachment 21188 [details] [review] New patch which allows an app to opt-out
This new patch allows an app to opt-out so that the daemon won't try to store it's data. This is useful for apps that provide a lot of targets or lots of data, such as gnumeric. The app simply has to make a __NO_STORE atom available in the clipboard. Example code: gchar *text; const GtkTargetEntry targets[] = { {"COMPOUND_TEXT", 0, 0}, {"__NO_STORE", 0, 0} }; text = gtk_editable_get_chars (entry, 0, -1); gtk_clipboard_set_with_data (clip, targets, 2, on_get, on_clear, text);
Note: you don't have to do anything with the __NO_STORE target. The clipboard daemon will only check for the atom's existance, not it's data.
I've committed a different patch that uses the clipboard manager spec instead.
*** Bug 470503 has been marked as a duplicate of this bug. ***