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

Unified Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2690553004: Fixes bug in DesktopWindowTreeHostMus's activation handling (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | ui/views/mus/desktop_window_tree_host_mus_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | ui/views/mus/desktop_window_tree_host_mus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698