From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:45:47 -0700
Subject: disable_hidden.patch


diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 9ab96c3f933b7ca0c8a7da396bd6015e620f2e81..28879dc5e9bb3f391513da6a7ad829244b39799d 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -712,6 +712,9 @@ void RenderWidgetHostImpl::WasHidden() {
   if (is_hidden_)
     return;
 
+  if (disable_hidden_)
+    return;
+
   RejectMouseLockOrUnlockIfNecessary();
 
   TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::WasHidden");
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 4af5870e7c40056b98e67f71c2c037490f2634f2..f2e19fe92e56d5d98a3ea0491a719c899b0cdcfe 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -154,6 +154,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
   // RenderWidgetHostImpl.
   static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);
 
+  // Electron: Prevents the widget from getting hidden.
+  bool disable_hidden_ = false;
+
   void set_hung_renderer_delay(const base::TimeDelta& delay) {
     hung_renderer_delay_ = delay;
   }
