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; |