diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-26 19:23:45 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-26 19:23:45 +0000 |
commit | f0847cab46640b76a083e9e9a8f0ad77703ce3c7 (patch) | |
tree | 5a3dc1fde14a226e6072b67bfefca95eac7d1467 /ui | |
parent | c22fe97351a03d56a32ea8ba4ace635ac256a222 (diff) | |
download | chromium_src-f0847cab46640b76a083e9e9a8f0ad77703ce3c7.zip chromium_src-f0847cab46640b76a083e9e9a8f0ad77703ce3c7.tar.gz chromium_src-f0847cab46640b76a083e9e9a8f0ad77703ce3c7.tar.bz2 |
Fixes bug where child Widgets wouldn't get deactivated on aura.
This makes it so a native activation change is propagated to the
ActivationClient. This way child widgets see the activation change
(assuming they were active) and can update state. This means a child
bubble closes properly.
I'm holding off on the test for now as it requires an interactive ui
test.
BUG=262085
TEST=see bug
R=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/20150003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213967 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/views/widget/desktop_aura/desktop_root_window_host_win.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc index e6c5880..59d4aa5 100644 --- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc @@ -56,7 +56,8 @@ DesktopRootWindowHostWin::DesktopRootWindowHostWin( internal::NativeWidgetDelegate* native_widget_delegate, DesktopNativeWidgetAura* desktop_native_widget_aura, const gfx::Rect& initial_bounds) - : message_handler_(new HWNDMessageHandler(this)), + : root_window_(NULL), + message_handler_(new HWNDMessageHandler(this)), native_widget_delegate_(native_widget_delegate), desktop_native_widget_aura_(desktop_native_widget_aura), root_window_host_delegate_(NULL), @@ -660,6 +661,19 @@ void DesktopRootWindowHostWin::HandleActivationChanged(bool active) { if (active) root_window_host_delegate_->OnHostActivated(); native_widget_delegate_->OnNativeWidgetActivationChanged(active); + // If we're not active we need to deactivate the corresponding aura::Window. + // This way if a child widget is active it gets correctly deactivated (child + // widgets don't get native desktop activation changes, only aura activation + // changes). + if (!active) { + aura::client::ActivationClient* activation_client = + aura::client::GetActivationClient(root_window_); + if (activation_client) { + aura::Window* active_window = activation_client->GetActiveWindow(); + if (active_window) + activation_client->DeactivateWindow(active_window); + } + } } bool DesktopRootWindowHostWin::HandleAppCommand(short command) { |