]> khamidou — GitHub mirrors - electron.git/commitdiff
views: Focus on web view when window is focused.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 08:04:14 +0000 (16:04 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 08:46:48 +0000 (16:46 +0800)
atom/browser/native_window_views.cc

index 44f06f3878b9abac745be10a12870df46e851668..a4b06c3afb1f3672595a40b72a1b452e285e23cf 100644 (file)
@@ -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);