From: Cheng Zhao Date: Thu, 7 Aug 2014 08:04:14 +0000 (+0800) Subject: views: Focus on web view when window is focused. X-Git-Tag: v0.15.4~2^2~2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=c2885f77c946cd42bb55a04353b2f97abfeec446;p=electron.git views: Focus on web view when window is focused. --- diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 44f06f38..a4b06c3a 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);