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

Unified Diff: ui/aura/dispatcher_linux.cc

Issue 10377161: aura-x11: Install the dispatcher as a message-pump observer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/dispatcher_linux.cc
diff --git a/ui/aura/dispatcher_linux.cc b/ui/aura/dispatcher_linux.cc
index e6e70d0d4f091bb26f13cb8ea7cd1aa892f211b6..87810c50cb87eef991884d53a3db00e6b5bd85a8 100644
--- a/ui/aura/dispatcher_linux.cc
+++ b/ui/aura/dispatcher_linux.cc
@@ -39,9 +39,11 @@ namespace aura {
DispatcherLinux::DispatcherLinux() {
base::MessagePumpX::SetDefaultDispatcher(this);
+ MessageLoopForUI::current()->AddObserver(this);
}
DispatcherLinux::~DispatcherLinux() {
+ MessageLoopForUI::current()->RemoveObserver(this);
base::MessagePumpX::SetDefaultDispatcher(NULL);
}
@@ -56,8 +58,6 @@ void DispatcherLinux::WindowDispatcherDestroying(::Window window) {
}
bool DispatcherLinux::Dispatch(const base::NativeEvent& xev) {
- PreprocessXEvent(xev);
-
// XI_HierarchyChanged events are special. There is no window associated with
// these events. So process them directly from here.
if (xev->type == GenericEvent &&
@@ -81,6 +81,15 @@ bool DispatcherLinux::Dispatch(const base::NativeEvent& xev) {
return dispatcher ? dispatcher->Dispatch(xev) : true;
}
+base::EventStatus DispatcherLinux::WillProcessEvent(
+ const base::NativeEvent& event) {
+ PreprocessXEvent(event);
+ return base::EVENT_CONTINUE;
+}
+
+void DispatcherLinux::DidProcessEvent(const base::NativeEvent& event) {
+}
+
MessageLoop::Dispatcher* DispatcherLinux::GetDispatcherForXEvent(
XEvent* xev) const {
::Window window = xev->xany.window;

Powered by Google App Engine
This is Rietveld 408576698