Chromium Code Reviews| Index: ui/views/mus/desktop_window_tree_host_mus.cc |
| diff --git a/ui/views/mus/desktop_window_tree_host_mus.cc b/ui/views/mus/desktop_window_tree_host_mus.cc |
| index 1b834c7d3f6e6de2308c696d833aabc0d0019bc0..e8dcb5b3a5e2c657cc662b7a27b2762d919704b5 100644 |
| --- a/ui/views/mus/desktop_window_tree_host_mus.cc |
| +++ b/ui/views/mus/desktop_window_tree_host_mus.cc |
| @@ -531,13 +531,16 @@ void DesktopWindowTreeHostMus::SetShape( |
| } |
| void DesktopWindowTreeHostMus::Activate() { |
| + if (!IsVisible()) |
| + return; |
| + |
| + // This should result in OnActiveFocusClientChanged() being called, which |
| + // triggers a call to DesktopNativeWidgetAura::HandleActivationChanged(), |
| + // which focuses the right window. |
| aura::Env::GetInstance()->SetActiveFocusClient( |
| aura::client::GetFocusClient(window()), window()); |
| - if (is_active_) { |
| - window()->Focus(); |
|
sky
2017/02/10 19:18:48
The explicit call to Focus() isn't necessary here
|
| - if (window()->GetProperty(aura::client::kDrawAttentionKey)) |
| - window()->SetProperty(aura::client::kDrawAttentionKey, false); |
| - } |
| + if (is_active_) |
| + window()->SetProperty(aura::client::kDrawAttentionKey, false); |
| } |
| void DesktopWindowTreeHostMus::Deactivate() { |