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-01-25 17:46:30 +00:00
|
|
|
index b62442d2213a7f55c66d19d3747f7f00c5b2aaa4..033634314d706196b5a68fc44114971d31bda3cb 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-01-03 08:52:49 +00:00
|
|
|
@@ -832,6 +832,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;
|
|
|
|
+
|
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
|
2024-01-25 17:46:30 +00:00
|
|
|
index 709246523b417943b4c64ef364312980d717e1bc..079b93338c3af4605c470b88934a32d1868eabe6 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-01-03 08:52:49 +00:00
|
|
|
@@ -914,6 +914,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-01-25 23:57:47 +00:00
|
|
|
index d81261500c208cbf1466ae23117ba3f5029d145a..8d07d5346afd62dd8b44b4ed4f7bc6c735fffea8 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-01-25 23:57:47 +00:00
|
|
|
@@ -618,7 +618,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();
|