2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-21 00:30:26 +00:00
|
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
|
|
Date: Thu, 20 Sep 2018 17:45:47 -0700
|
|
|
|
Subject: disable_hidden.patch
|
|
|
|
|
2019-12-13 17:18:45 +00:00
|
|
|
Electron uses this to disable background throttling for hidden windows.
|
2018-09-21 00:30:26 +00:00
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
2021-01-12 23:31:23 +00:00
|
|
|
index 3118dfdb4bc73664b0dc362b7f0506e750ece93d..603db59e5ef4f4dd07350fdeee883eb896966ecd 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/renderer_host/render_widget_host_impl.cc
|
|
|
|
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
2021-01-12 23:31:23 +00:00
|
|
|
@@ -722,6 +722,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
2018-09-14 05:02:16 +00:00
|
|
|
if (is_hidden_)
|
|
|
|
return;
|
|
|
|
|
|
|
|
+ if (disable_hidden_)
|
|
|
|
+ return;
|
|
|
|
+
|
2020-03-14 20:54:14 +00:00
|
|
|
RejectMouseLockOrUnlockIfNecessary(
|
|
|
|
blink::mojom::PointerLockResult::kWrongDocument);
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
|
2021-01-12 23:31:23 +00:00
|
|
|
index 3dd95dcf37cbc3b73b79b098524bf05666e1b9de..57cb297221c01994580e3a0f3546fbad3d5ba6f5 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/renderer_host/render_widget_host_impl.h
|
|
|
|
+++ b/content/browser/renderer_host/render_widget_host_impl.h
|
2021-01-12 23:31:23 +00:00
|
|
|
@@ -186,6 +186,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
2018-09-14 05:02:16 +00:00
|
|
|
// RenderWidgetHostImpl.
|
|
|
|
static RenderWidgetHostImpl* From(RenderWidgetHost* rwh);
|
|
|
|
|
|
|
|
+ // Electron: Prevents the widget from getting hidden.
|
|
|
|
+ bool disable_hidden_ = false;
|
|
|
|
+
|
2020-04-06 20:09:52 +00:00
|
|
|
void set_new_content_rendering_delay_for_testing(
|
|
|
|
const base::TimeDelta& delay) {
|
|
|
|
new_content_rendering_delay_ = delay;
|
2020-03-26 19:54:11 +00:00
|
|
|
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
2021-01-25 16:46:00 +00:00
|
|
|
index 70e2acf7cff6d5a08550c648330dc8a4b2a960a5..18ba6606b41c5394d70caa67685679decfcea5b5 100644
|
2020-03-26 19:54:11 +00:00
|
|
|
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
|
|
|
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
2021-01-25 16:46:00 +00:00
|
|
|
@@ -607,7 +607,7 @@ void RenderWidgetHostViewAura::HideImpl() {
|
2020-03-26 19:54:11 +00:00
|
|
|
DCHECK(visibility_ == Visibility::HIDDEN ||
|
|
|
|
visibility_ == Visibility::OCCLUDED);
|
|
|
|
|
|
|
|
- if (!host()->is_hidden()) {
|
|
|
|
+ if (!host()->is_hidden() && !host()->disable_hidden_) {
|
|
|
|
host()->WasHidden();
|
|
|
|
aura::WindowTreeHost* host = window_->GetHost();
|
|
|
|
if (delegated_frame_host_) {
|