Index: ui/events/platform/x11/x11_event_source.cc |
diff --git a/ui/events/platform/x11/x11_event_source.cc b/ui/events/platform/x11/x11_event_source.cc |
index b27acd877ee1e734fbbe937a6b9abddf168fda24..dd13e8b769694691790a6f16b2f0e6fd5fec374d 100644 |
--- a/ui/events/platform/x11/x11_event_source.cc |
+++ b/ui/events/platform/x11/x11_event_source.cc |
@@ -238,7 +238,11 @@ void X11EventSource::ExtractCookieDataDispatchEvent(XEvent* xevent) { |
dispatching_event_ = xevent; |
- delegate_->ProcessXEvent(xevent); |
+ if (!filter_ || !filter_->OnPlatformEvent(xevent)) { |
+ delegate_->ProcessXEvent(xevent); |
+ } else { |
+ LOG(ERROR) << "Block XEvent " << xevent; |
+ } |
PostDispatchEvent(xevent); |
dispatching_event_ = nullptr; |
@@ -301,4 +305,9 @@ void X11EventSource::OnDispatcherListChanged() { |
} |
} |
+void X11EventSource::set_platform_key_event_filter( |
+ keyboard_lock::PlatformKeyEventFilter* filter) { |
+ filter_ = filter; |
+} |
+ |
} // namespace ui |