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
|
2022-04-22 22:36:22 +00:00
|
|
|
index 9e740edbf36dd7a30062c88f857103c56eebd729..7cda66952e0d3a67c32791ad3c7d7de8df03f876 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
|
2022-04-12 11:19:14 +00:00
|
|
|
@@ -808,6 +808,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
|
2022-04-22 22:36:22 +00:00
|
|
|
index 23783e5e004b613c27fd753e1f7ff96d51fa5f68..225b4ea0c5ac74d6b6700c306182d003a972cedc 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
|
2022-04-22 22:36:22 +00:00
|
|
|
@@ -886,6 +886,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
2022-03-25 01:39:03 +00:00
|
|
|
|
|
|
|
SiteInstanceGroup* GetSiteInstanceGroup();
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
+ // Electron: Prevents the widget from getting hidden.
|
|
|
|
+ bool disable_hidden_ = false;
|
|
|
|
+
|
2021-02-09 20:16:21 +00:00
|
|
|
protected:
|
|
|
|
// |routing_id| must not be MSG_ROUTING_NONE.
|
|
|
|
// If this object outlives |delegate|, DetachDelegate() must be called when
|
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
|
2022-04-22 22:36:22 +00:00
|
|
|
index 5f29761ad8556e730dca6b076b87f6391313fb95..3e5f5a34150079bf74d612bff85b6875ad41d2e6 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
|
2022-04-12 11:19:14 +00:00
|
|
|
@@ -605,7 +605,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();
|
2021-02-09 20:16:21 +00:00
|
|
|
aura::Window* parent = window_->parent();
|