electron/patches/common/chromium/disable_hidden.patch
2019-03-08 15:06:16 -08:00

34 lines
1.4 KiB
Diff

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 40307f946099ea7ff1f438860f5d70acd9b979d1..1515dcfff07c6483217bc37e6897b3385eba1343 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -766,6 +766,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 b6a90bdd0122bbf25b89e3b38032ff86b1fdf1e0..125c6bf091ce2b2eca308e72b31f5aec6351f827 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -153,6 +153,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;
}