Index: ui/views/widget/desktop_aura/desktop_focus_rules.cc |
diff --git a/ui/views/widget/desktop_aura/desktop_focus_rules.cc b/ui/views/widget/desktop_aura/desktop_focus_rules.cc |
index c63250c42468a811e165890b96bf998886a47e51..16f71c586a50230e00c65a4b12edffac7813adcc 100644 |
--- a/ui/views/widget/desktop_aura/desktop_focus_rules.cc |
+++ b/ui/views/widget/desktop_aura/desktop_focus_rules.cc |
@@ -14,6 +14,14 @@ DesktopFocusRules::DesktopFocusRules(aura::Window* content_window) |
DesktopFocusRules::~DesktopFocusRules() {} |
+bool DesktopFocusRules::CanActivateWindow(aura::Window* window) const { |
+ if (!BaseFocusRules::CanActivateWindow(window)) |
+ return false; |
+ // Never activate a window that is not a child of the root window. Transients |
+ // spanning different DesktopNativeWidgetAuras may trigger this. |
+ return !window || content_window_->GetRootWindow()->Contains(window); |
+} |
+ |
bool DesktopFocusRules::SupportsChildActivation(aura::Window* window) const { |
// In Desktop-Aura, only the content_window or children of the RootWindow are |
// activatable. |