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

Unified Diff: ui/events/platform/x11/x11_event_source.cc

Issue 219743002: x11: Move X event handling out of the message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r261267 Created 6 years, 9 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
« no previous file with comments | « ui/events/platform/platform_event_source_stub.cc ('k') | ui/views/controls/menu/menu_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/events/platform/platform_event_source_stub.cc ('k') | ui/views/controls/menu/menu_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698