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

Unified Diff: ui/aura/window_tree_host_x11.cc

Issue 2319933002: X11: Remove calls to XSelectInput (Closed)
Patch Set: 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/aura/window_tree_host_x11.cc
diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
index 0bbd0a0ce0e799f47c777b9438f6d89e5cb8fea0..1e9d415ddec3282818eaa147d1302922e4701244 100644
--- a/ui/aura/window_tree_host_x11.cc
+++ b/ui/aura/window_tree_host_x11.cc
@@ -34,6 +34,7 @@
#include "ui/base/ui_base_switches.h"
#include "ui/base/view_prop.h"
#include "ui/base/x/x11_util.h"
+#include "ui/base/x/x11_window_event_manager.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/dip_util.h"
#include "ui/compositor/layer.h"
@@ -133,12 +134,11 @@ WindowTreeHostX11::WindowTreeHostX11(const gfx::Rect& bounds)
ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask |
Daniel Erat 2016/09/07 22:58:36 mind moving this mask into a kEventMask constant i
- KeyPressMask | KeyReleaseMask |
- EnterWindowMask | LeaveWindowMask |
- ExposureMask | VisibilityChangeMask |
+ KeyPressMask | KeyReleaseMask | EnterWindowMask |
+ LeaveWindowMask | ExposureMask | VisibilityChangeMask |
StructureNotifyMask | PropertyChangeMask |
PointerMotionMask;
- XSelectInput(xdisplay_, xwindow_, event_mask);
+ xwindow_events_.reset(new ui::XScopedEventSelector(xwindow_, event_mask));
XFlush(xdisplay_);
if (ui::IsXInput2Available()) {
@@ -470,6 +470,19 @@ void WindowTreeHostX11::MoveCursorToNative(const gfx::Point& location) {
void WindowTreeHostX11::OnCursorVisibilityChangedNative(bool show) {
}
+void WindowTreeHostX11::DisableInput() {
+ long event_mask = ExposureMask | VisibilityChangeMask | StructureNotifyMask |
+ PropertyChangeMask;
+ auto event_selector = new ui::XScopedEventSelector(xwindow_, event_mask);
+ xwindow_events_.reset(event_selector);
Daniel Erat 2016/09/07 22:58:36 xwindow_events_.reset(new ui::XScopedEventSelector
Tom (Use chromium acct) 2016/09/07 23:31:16 Done.
+ unsigned char mask[XIMaskLen(XI_LASTEVENT)] = {0};
+ XIEventMask evmask;
+ evmask.deviceid = XIAllDevices;
+ evmask.mask_len = sizeof(mask);
+ evmask.mask = mask;
+ XISelectEvents(gfx::GetXDisplay(), xwindow_, &evmask, 1);
+}
+
void WindowTreeHostX11::DispatchXI2Event(const base::NativeEvent& event) {
ui::TouchFactory* factory = ui::TouchFactory::GetInstance();
XEvent* xev = event;

Powered by Google App Engine
This is Rietveld 408576698