summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 23:49:29 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 23:49:29 +0000
commitf0a94b593178cfe95dd16424cca6a0144de0d440 (patch)
tree0824af0b4f19b998c9744f5d147a8c23941129dc /app
parentc602959a22c63d3b9f78c198a4b4a5b3b03ad401 (diff)
downloadchromium_src-f0a94b593178cfe95dd16424cca6a0144de0d440.zip
chromium_src-f0a94b593178cfe95dd16424cca6a0144de0d440.tar.gz
chromium_src-f0a94b593178cfe95dd16424cca6a0144de0d440.tar.bz2
GTK: Store the contents of the clipboard to the clipboard manager on exit.
BUG=21744 TEST=Copy text from a webpage. Paste it into gedit. Close chrome. You should still be able to paste into gedit. Review URL: http://codereview.chromium.org/5357011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67782 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r--app/clipboard/clipboard_linux.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/clipboard/clipboard_linux.cc b/app/clipboard/clipboard_linux.cc
index 4c833fb..8408614e 100644
--- a/app/clipboard/clipboard_linux.cc
+++ b/app/clipboard/clipboard_linux.cc
@@ -101,9 +101,7 @@ Clipboard::Clipboard() : clipboard_data_(NULL) {
}
Clipboard::~Clipboard() {
- // TODO(estade): do we want to save clipboard data after we exit?
- // gtk_clipboard_set_can_store and gtk_clipboard_store work
- // but have strangely awful performance.
+ gtk_clipboard_store(clipboard_);
}
void Clipboard::WriteObjects(const ObjectMap& objects) {
@@ -138,10 +136,14 @@ void Clipboard::SetGtkClipboard() {
targets[i].info = 0;
}
- gtk_clipboard_set_with_data(clipboard_, targets.get(),
- clipboard_data_->size(),
- GetData, ClearData,
- clipboard_data_);
+ if (gtk_clipboard_set_with_data(clipboard_, targets.get(),
+ clipboard_data_->size(),
+ GetData, ClearData,
+ clipboard_data_)) {
+ gtk_clipboard_set_can_store(clipboard_,
+ targets.get(),
+ clipboard_data_->size());
+ }
// clipboard_data_ now owned by the GtkClipboard.
clipboard_data_ = NULL;