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-03-15 18:03:42 +00:00
|
|
|
index 7f63e954dc68a82699e06b5e611c590faf342a6b..df4a7d191281af4602517ecc7300235ceb4e6799 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-03-05 16:47:48 +00:00
|
|
|
@@ -749,6 +749,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-03-13 08:44:49 +00:00
|
|
|
index fb89c4500eeae064c6c8f3d4c0ad7b5b4deecb5a..52868268ba4843e0743284afc684e549011c4110 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-03-13 08:44:49 +00:00
|
|
|
@@ -920,6 +920,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-03-13 08:44:49 +00:00
|
|
|
index 094686284afc96d9719ca1821092863d1e160e0c..4c78692adb777b8e0a8fa2e2350775b7e2ef676a 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();
|