Index: ui/views/widget/widget.cc |
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc |
index 6063a224684cb38ec980a29621197060167065c1..719ff108106512c4c2f262b61ad3136f41ffadeb 100644 |
--- a/ui/views/widget/widget.cc |
+++ b/ui/views/widget/widget.cc |
@@ -1305,10 +1305,13 @@ bool Widget::SetInitialFocus(ui::WindowShowState show_state) { |
} |
if (v) { |
v->RequestFocus(); |
- // If the request for focus was unsuccessful, fall back to using the first |
+ // If the Widget is active (thus allowing its child Views to receive focus), |
+ // but the request for focus was unsuccessful, fall back to using the first |
// focusable View instead. |
- if (focus_manager && focus_manager->GetFocusedView() == nullptr) |
+ if (focus_manager && focus_manager->GetFocusedView() == nullptr && |
+ IsActive()) { |
focus_manager->AdvanceFocus(false); |
+ } |
} |
return !!focus_manager->GetFocusedView(); |
} |