| Index: ui/views/widget/native_widget_aura.cc
|
| diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
|
| index 85ab0aee9c0de3c74cd08d52dc8b9764d3a1a745..aca2d2364aafa24354cd9b65a7f575da5cd98eb1 100644
|
| --- a/ui/views/widget/native_widget_aura.cc
|
| +++ b/ui/views/widget/native_widget_aura.cc
|
| @@ -495,7 +495,10 @@ void NativeWidgetAura::ShowWithWindowState(ui::WindowShowState state) {
|
| // SetInitialFocus() should be always be called, even for
|
| // SHOW_STATE_INACTIVE. If the window has to stay inactive, the method will
|
| // do the right thing.
|
| - SetInitialFocus(state);
|
| + // Activate() might fail if the window is non-activatable. In this case, we
|
| + // should pass SHOW_STATE_INACTIVE to SetInitialFocus() to stop the initial
|
| + // focused view from getting focused. See crbug.com/515594 for example.
|
| + SetInitialFocus(IsActive() ? state : ui::SHOW_STATE_INACTIVE);
|
| }
|
|
|
| // On desktop aura, a window is activated first even when it is shown as
|
|
|