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
|
2024-04-15 22:10:32 +00:00
|
|
|
index 9164e80bef0ce1406d238c90eb704aba743dabee..b431e0817bade8a5bc2f13bacf48261c9e860aed 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
|
2024-04-15 22:10:32 +00:00
|
|
|
@@ -742,6 +742,9 @@ void RenderWidgetHostImpl::WasHidden() {
|
2018-09-14 05:02:16 +00:00
|
|
|
return;
|
2023-05-23 19:58:58 +00:00
|
|
|
}
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
+ if (disable_hidden_)
|
|
|
|
+ return;
|
|
|
|
+
|
2024-01-31 23:04:13 +00:00
|
|
|
RejectPointerLockOrUnlockIfNecessary(
|
2020-03-14 20:54:14 +00:00
|
|
|
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
|
2024-04-15 22:10:32 +00:00
|
|
|
index 0ba4895bdc6e8d9d83f68ae1b8adef177ee775c6..518cf718ccadc2c341973330d74b76d6e7538920 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
|
2024-04-15 22:10:32 +00:00
|
|
|
@@ -915,6 +915,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
2022-10-27 16:37:04 +00:00
|
|
|
void UpdateBrowserControlsState(cc::BrowserControlsState constraints,
|
|
|
|
cc::BrowserControlsState current,
|
|
|
|
bool animate);
|
2018-09-14 05:02:16 +00:00
|
|
|
+ // Electron: Prevents the widget from getting hidden.
|
|
|
|
+ bool disable_hidden_ = false;
|
2022-10-27 16:37:04 +00:00
|
|
|
|
2023-09-06 01:17:56 +00:00
|
|
|
void StartDragging(blink::mojom::DragDataPtr drag_data,
|
2023-10-02 22:01:07 +00:00
|
|
|
const url::Origin& source_origin,
|
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
|
2024-04-15 22:10:32 +00:00
|
|
|
index a52e22d0d43e3264619b3ad75c367b8f45fec905..62268258f626eab8dd73c3a0b0bc3c84e8bc7eae 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
|
2024-03-05 16:47:48 +00:00
|
|
|
@@ -614,7 +614,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();
|