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 63cba762c252d0fe61c40137db16ad494600341d..c4d2f46d09b5360c98c5a6b9332c9b411f7bb5b0 100644 |
--- a/ui/events/platform/x11/x11_event_source.cc |
+++ b/ui/events/platform/x11/x11_event_source.cc |
@@ -13,6 +13,7 @@ |
#include "base/logging.h" |
#include "base/message_loop/message_loop.h" |
#include "ui/events/platform/platform_event_dispatcher.h" |
+#include "ui/gfx/x/x11_types.h" |
namespace ui { |
@@ -192,10 +193,23 @@ uint32_t X11EventSource::DispatchEvent(XEvent* xevent) { |
XGetEventData(xevent->xgeneric.display, &xevent->xcookie)) { |
have_cookie = true; |
} |
- int action = PlatformEventSource::DispatchEvent(xevent); |
+ |
+ // TODO(sad): Remove this once all MessagePumpObservers are turned into |
+ // PlatformEventObservers. |
+ uint32_t action = ui::POST_DISPATCH_NONE; |
+ if (!base::MessagePumpX11::Current()->WillProcessXEvent(xevent)) { |
+ action = PlatformEventSource::DispatchEvent(xevent); |
+ base::MessagePumpX11::Current()->DidProcessXEvent(xevent); |
+ } |
+ |
if (have_cookie) |
XFreeEventData(xevent->xgeneric.display, &xevent->xcookie); |
return action; |
} |
+scoped_ptr<PlatformEventSource> PlatformEventSource::CreateDefault() { |
+ return scoped_ptr<PlatformEventSource>( |
+ new X11EventSource(gfx::GetXDisplay())); |
+} |
+ |
} // namespace ui |