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

Unified Diff: ui/base/clipboard/clipboard_aurax11.cc

Issue 2319933002: X11: Remove calls to XSelectInput (Closed)
Patch Set: Use WeakPtr Created 4 years, 3 months 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
Index: ui/base/clipboard/clipboard_aurax11.cc
diff --git a/ui/base/clipboard/clipboard_aurax11.cc b/ui/base/clipboard/clipboard_aurax11.cc
index fb77168294833021f7f2a3593705f2854f2f028f..9a353a148314789636e973eac3729ece6a00c972 100644
--- a/ui/base/clipboard/clipboard_aurax11.cc
+++ b/ui/base/clipboard/clipboard_aurax11.cc
@@ -28,6 +28,7 @@
#include "ui/base/x/selection_requestor.h"
#include "ui/base/x/selection_utils.h"
#include "ui/base/x/x11_util.h"
+#include "ui/base/x/x11_window_event_manager.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/events/platform/platform_event_observer.h"
#include "ui/events/platform/platform_event_source.h"
@@ -301,6 +302,9 @@ class ClipboardAuraX11::AuraX11Details : public PlatformEventDispatcher {
// Input-only window used as a selection owner.
::Window x_window_;
+ // Events selected on |x_window_|.
+ std::unique_ptr<XScopedEventSelector> x_window_events_;
+
X11AtomCache atom_cache_;
// Object which requests and receives selection data.
@@ -339,7 +343,8 @@ ClipboardAuraX11::AuraX11Details::AuraX11Details()
atom_cache_.allow_uncached_atoms();
XStoreName(x_display_, x_window_, "Chromium clipboard");
- XSelectInput(x_display_, x_window_, PropertyChangeMask);
+ x_window_events_.reset(
+ new XScopedEventSelector(x_window_, PropertyChangeMask));
if (PlatformEventSource::GetInstance())
PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);

Powered by Google App Engine
This is Rietveld 408576698