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

Unified Diff: ui/aura/env.cc

Issue 10895020: Merge aura::DispatcherLinux into base::MessagePumpAuraX11. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes for sadrul Created 8 years, 4 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/aura/env.h ('k') | ui/aura/root_window_host_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env.cc
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index 90f3fbff4e20e2bfc4508d813d81ef9d32e25947..6c40697adde3c6d1e73d6b6f9554785f609c2b13 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -15,6 +15,7 @@
#include "ui/compositor/compositor_switches.h"
#if defined(USE_X11)
+#include "base/message_pump_aurax11.h"
#include "ui/aura/display_change_observer_x11.h"
#endif
@@ -35,6 +36,11 @@ Env::Env()
}
Env::~Env() {
+#if defined(USE_X11)
+ base::MessagePumpAuraX11::Current()->RemoveObserver(
+ &device_list_updater_aurax11_);
+#endif
+
ui::Compositor::Terminate();
}
@@ -97,7 +103,11 @@ void Env::SetEventFilter(EventFilter* event_filter) {
#if !defined(OS_MACOSX)
MessageLoop::Dispatcher* Env::GetDispatcher() {
+#if defined(USE_X11)
+ return base::MessagePumpAuraX11::Current();
+#else
return dispatcher_.get();
+#endif
}
#endif
@@ -105,11 +115,16 @@ MessageLoop::Dispatcher* Env::GetDispatcher() {
// Env, private:
void Env::Init() {
-#if !defined(OS_MACOSX)
+#if defined(OS_WIN)
dispatcher_.reset(CreateDispatcher());
#endif
#if defined(USE_X11)
display_change_observer_.reset(new internal::DisplayChangeObserverX11);
+
+ // We can't do this with a root window listener because XI_HierarchyChanged
+ // messages don't have a target window.
+ base::MessagePumpAuraX11::Current()->AddObserver(
+ &device_list_updater_aurax11_);
#endif
ui::Compositor::Initialize(
CommandLine::ForCurrentProcess()->HasSwitch(
« no previous file with comments | « ui/aura/env.h ('k') | ui/aura/root_window_host_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698