Chromium Code Reviews| Index: remoting/host/linux/x_server_clipboard.cc |
| diff --git a/remoting/host/linux/x_server_clipboard.cc b/remoting/host/linux/x_server_clipboard.cc |
| index 8e05fdaba18d6e4be203a9fab88a521a57125490..f15a8d96cb2ffabb02dc485c87b1bad92031e8f6 100644 |
| --- a/remoting/host/linux/x_server_clipboard.cc |
| +++ b/remoting/host/linux/x_server_clipboard.cc |
| @@ -11,6 +11,7 @@ |
| #include "remoting/base/constants.h" |
| #include "remoting/base/logging.h" |
| #include "remoting/base/util.h" |
| +#include "ui/base/x/x11_util.h" |
| namespace remoting { |
| @@ -55,31 +56,12 @@ void XServerClipboard::Init(Display* display, |
| 0, 0, 1, 1, // x, y, width, height |
| 0, 0, 0); |
| - // TODO(lambroslambrou): Use ui::X11AtomCache for this, either by adding a |
| - // dependency on ui/ or by moving X11AtomCache to base/. |
| - static const char* const kAtomNames[] = { |
| - "CLIPBOARD", |
| - "INCR", |
| - "SELECTION_STRING", |
| - "TARGETS", |
| - "TIMESTAMP", |
| - "UTF8_STRING" |
| - }; |
| - static const int kNumAtomNames = arraysize(kAtomNames); |
| - |
| - Atom atoms[kNumAtomNames]; |
| - if (XInternAtoms(display_, const_cast<char**>(kAtomNames), kNumAtomNames, |
| - False, atoms)) { |
| - clipboard_atom_ = atoms[0]; |
| - large_selection_atom_ = atoms[1]; |
| - selection_string_atom_ = atoms[2]; |
| - targets_atom_ = atoms[3]; |
| - timestamp_atom_ = atoms[4]; |
| - utf8_string_atom_ = atoms[5]; |
| - static_assert(kNumAtomNames >= 6, "kAtomNames is too small"); |
| - } else { |
| - LOG(ERROR) << "XInternAtoms failed"; |
| - } |
| + clipboard_atom_ = ui::GetAtom("CLIPLBOARD"); |
|
Sergey Ulanov
2017/06/01 20:40:09
This uses a different X connection, so I don't thi
Tom Anderson
2017/06/01 21:20:42
Done.
|
| + large_selection_atom_ = ui::GetAtom("INCR"); |
| + selection_string_atom_ = ui::GetAtom("SELECTION_STRING"); |
| + targets_atom_ = ui::GetAtom("TARGETS"); |
| + timestamp_atom_ = ui::GetAtom("TIMESTAMP"); |
| + utf8_string_atom_ = ui::GetAtom("UTF8_STRING"); |
| XFixesSelectSelectionInput(display_, clipboard_window_, clipboard_atom_, |
|
sadrul
2017/06/01 20:45:30
Same here. Looks like this |display_| is one initi
Tom Anderson
2017/06/01 21:20:42
Done.
|
| XFixesSetSelectionOwnerNotifyMask); |