Files
electron/patches/chromium/disable_hidden.patch
electron-roller[bot] a1f0ef80d4 chore: bump chromium to 145.0.7616.0 (main) (#49279)
* chore: bump chromium in DEPS to 145.0.7605.0

* chore: bump chromium in DEPS to 145.0.7606.0

* chore: bump chromium in DEPS to 145.0.7608.0

* chore: update patches

* chore: bump chromium in DEPS to 145.0.7610.0

* chore: update patches

* [InputVizard] Fix missing touch cancel in InputTransferHandlerAndroid
using InputEventSource

Refs https://chromium-review.googlesource.com/c/chromium/src/+/7302368

* chore: bump chromium in DEPS to 145.0.7611.0

* chore: update patches

* chore: bump chromium in DEPS to 145.0.7614.0

* chore: bump chromium in DEPS to 145.0.7615.0

* chore: update patches

* chore: bump chromium in DEPS to 145.0.7616.0

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2026-01-05 13:34:36 -05:00

49 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:45:47 -0700
Subject: disable_hidden.patch
Electron uses this to disable background throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 19d61d87d973e6ca7039b5387a9a0fe61f7203dc..744bfbc9e0e5bfc7440dc199375f90eb87dc2673 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -847,6 +847,10 @@ void RenderWidgetHostImpl::WasHidden() {
return;
}
+ if (disable_hidden_) {
+ return;
+ }
+
// Cancel pending pointer lock requests, unless there's an open user prompt.
// Prompts should remain open and functional across tab switches.
if (!delegate_ || !delegate_->IsWaitingForPointerLockPrompt(this)) {
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 42cff4d713ac144f4cdb6433288d919c84eb2961..4d570955274be46a3e1e6117de7753db5bd3461e 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -1034,6 +1034,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
return synthetic_gesture_controller_.get();
}
+ // Electron: Prevents the widget from getting hidden.
+ bool disable_hidden_ = false;
protected:
// |routing_id| must not be IPC::mojom::kRoutingIdNone.
// If this object outlives |delegate|, DetachDelegate() must be called when
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 3c1f05313dc444f4e303e1d789db781953b824a4..4df91cea76224362565bb968852d05c1a4f865f9 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -710,7 +710,7 @@ void RenderWidgetHostViewAura::HideImpl() {
CHECK(visibility_ == Visibility::HIDDEN ||
visibility_ == Visibility::OCCLUDED);
- if (!host()->IsHidden()) {
+ if (!host()->IsHidden() && !host()->disable_hidden_) {
host()->WasHidden();
aura::WindowTreeHost* host = window_->GetHost();
aura::Window* parent = window_->parent();