Files
electron/patches/chromium/disable_hidden.patch
electron-roller[bot] 29e0948f7b chore: bump chromium to 143.0.7497.0 (main) (#48657)
* chore: bump chromium in DEPS to 143.0.7492.0

* chore: bump chromium in DEPS to 143.0.7493.0

* chore: update mas_avoid_private_macos_api_usage.patch.patch

Move os_crypt/sync and os_crypt/async shared code to os_crypt/common | https://chromium-review.googlesource.com/c/chromium/src/+/7081087

* chore: update add_didinstallconditionalfeatures.patch

no manual changes; patch applied with fuzz

Reland "Remove BackForwardTransitions flag" | https://chromium-review.googlesource.com/c/chromium/src/+/7079411

* chore: update printing.patch

Avoid a reachable NOTREACHED() in PrintingContextLinux | https://chromium-review.googlesource.com/c/chromium/src/+/7081117

* chore: update allow_in-process_windows_to_have_different_web_prefs.patch

patch reapplied manually due to context shear

Reland "Remove BackForwardTransitions flag" | https://chromium-review.googlesource.com/c/chromium/src/+/7079411

* chore: update chore_provide_iswebcontentscreationoverridden_with_full_params.patch

patch reapplied manually due to context shear

Cleanup: format some content files | https://chromium-review.googlesource.com/c/chromium/src/+/7083290

* chore: update feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch

patch manually reapplied for files moved upstream

Move os_crypt/sync and os_crypt/async shared code to os_crypt/common | https://chromium-review.googlesource.com/c/chromium/src/+/7081087

* chore: update revert_cleanup_remove_feature_windelayspellcheckserviceinit.patch

no manual changes; patch applied with fuzz

[spelling+grammar restrictions] fix feature param name | https://chromium-review.googlesource.com/c/chromium/src/+/7081186

* chore: update patches

* chore: fix broken includes in ElectronBrowserMainParts

Move os_crypt/sync and os_crypt/async shared code to os_crypt/common | https://chromium-review.googlesource.com/c/chromium/src/+/7081087

* chore: bump chromium in DEPS to 143.0.7495.0

* chore: fixup patch indices

* chore: bump chromium in DEPS to 143.0.7497.0

* chore: fixup patch indices

* 7085081: Roll libc++ from d6739a332fe9 to bc00f6e9f739 (1 revision)

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

* 7081087: Move os_crypt/sync and os_crypt/async shared code to os_crypt/common

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

* test: fix failing spec

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-10-28 11:17:29 -04: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 16c3a86ec4543c95d37198cf7c90f8d2285d2337..1c74f5f7de96f5950b7eac3348528970aae7175c 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -841,6 +841,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 2d32d91eb98fe749ae262ba06a1a399813aa7bab..8ebf542046ffba6823804b797e373c80bab12873 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -1031,6 +1031,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 816bb7c6f1c00c121f66e67d20d709008c33f02f..d97cbb4fd8e12bcbff19bf8cc8378997110c60c0 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -696,7 +696,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();