electron/patches/chromium/disable_hidden.patch

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 0ccc622fd1891f921bee7ec1f162226081cccc4e..1fcbec659652d572bccd0ea03992f566846d65ac 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -670,6 +670,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 cf54a5f5ead088055d83f32eba03a09cf6c530df..d22480ae0196d46ae7c5c60e153435bb7e0989fd 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -155,6 +155,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;
}