diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-24 14:16:51 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-24 14:16:51 +0000 |
commit | f0b92f43273f6de84c9d91efce2ece7d075d2034 (patch) | |
tree | ba4424d6fb26b89ec7b7081681db09e9c4530699 /ui/aura/env.cc | |
parent | b098eca316ffe0da9c630939d18fdb741a2f40d2 (diff) | |
download | chromium_src-f0b92f43273f6de84c9d91efce2ece7d075d2034.zip chromium_src-f0b92f43273f6de84c9d91efce2ece7d075d2034.tar.gz chromium_src-f0b92f43273f6de84c9d91efce2ece7d075d2034.tar.bz2 |
* Keep the mouse in the desktop in multi monitor environment. I ended up using XFIXES to make launcher autohide works smoothlyl.
* Made dtor of ML::Dispatcher publiic and Eliminated aura::Dispatcher
* Refactored DispatcherLinux so that it re-dispatch event per window.
* Removed ConfineToWindow in RHWVA::LockMouse because a) it's not necessary on device (mouse is always confined to root window), b) it should
confine to the RWHVA's window but not root window, so this is not exactly right. I'll work on this in separate CL after m19.
BUG=115510
TEST=none
Review URL: http://codereview.chromium.org/9808010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128739 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/env.cc')
-rw-r--r-- | ui/aura/env.cc | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/ui/aura/env.cc b/ui/aura/env.cc index 32ead2b..6da06ef 100644 --- a/ui/aura/env.cc +++ b/ui/aura/env.cc @@ -23,16 +23,7 @@ Env* Env::instance_ = NULL; Env::Env() : mouse_button_flags_(0), - stacking_client_(NULL), - monitor_manager_(new internal::SingleMonitorManager) -#if defined(USE_X11) - , monitor_change_observer_(new MonitorChangeObserverX11()) -#endif -{ -#if !defined(OS_MACOSX) - dispatcher_.reset(CreateDispatcher()); -#endif - ui::Compositor::Initialize(false); + stacking_client_(NULL) { } Env::~Env() { @@ -41,8 +32,10 @@ Env::~Env() { // static Env* Env::GetInstance() { - if (!instance_) + if (!instance_) { instance_ = new Env; + instance_->Init(); + } return instance_; } @@ -62,6 +55,10 @@ void Env::RemoveObserver(EnvObserver* observer) { void Env::SetMonitorManager(MonitorManager* monitor_manager) { monitor_manager_.reset(monitor_manager); +#if defined(USE_X11) + // Update the monitor manager with latest info. + monitor_change_observer_->NotifyMonitorChange(); +#endif } #if !defined(OS_MACOSX) @@ -73,6 +70,17 @@ MessageLoop::Dispatcher* Env::GetDispatcher() { //////////////////////////////////////////////////////////////////////////////// // Env, private: +void Env::Init() { +#if !defined(OS_MACOSX) + dispatcher_.reset(CreateDispatcher()); +#endif +#if defined(USE_X11) + monitor_change_observer_.reset(new internal::MonitorChangeObserverX11); +#endif + SetMonitorManager(new internal::SingleMonitorManager); + ui::Compositor::Initialize(false); +} + void Env::NotifyWindowInitialized(Window* window) { FOR_EACH_OBSERVER(EnvObserver, observers_, OnWindowInitialized(window)); } |