From c2885f77c946cd42bb55a04353b2f97abfeec446 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 7 Aug 2014 16:04:14 +0800 Subject: [PATCH] views: Focus on web view when window is focused. --- atom/browser/native_window_views.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 44f06f3878..a4b06c3afb 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -456,6 +456,9 @@ void NativeWindowViews::OnWidgetActivationChanged( else NotifyWindowBlur(); + if (active && GetWebContents() && !IsDevToolsOpened()) + GetWebContents()->Focus(); + // Hide menu bar when window is blured. if (!active && menu_bar_autohide_ && menu_bar_show_) { SetMenuBarVisibility(false);