Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Unified Diff: app/clipboard/clipboard_linux.cc

Issue 5357011: GTK: Store the contents of the clipboard to the clipboard manager on exit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/clipboard/clipboard_linux.cc
diff --git a/app/clipboard/clipboard_linux.cc b/app/clipboard/clipboard_linux.cc
index 4c833fb6a7ed6a96b656a5c6ac73ac205536f2fb..8408614e53b7518a71138c5ade047f3cb613980e 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_);
Evan Stade 2010/11/30 21:37:11 shouldn't we only call this if we own the clipboar
Elliot Glaysher 2010/11/30 21:50:29 I'm not sure I understand. What does that mean and
Elliot Glaysher 2010/11/30 22:03:36 OK, I don't think so. I did the following test: -
Evan Stade 2010/11/30 22:05:00 actually, this might not be the right place to cal
}
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698