Compare commits

...

7 Commits

Author SHA1 Message Date
George Xu
c204bb9d1b check was in the wrong place 2024-07-19 11:15:16 -07:00
George Xu
f19534f549 add check 2024-07-19 11:15:15 -07:00
George Xu
4e38a1353f Revert "add check"
This reverts commit a09003c6fb2c55d1fb1cb303b621c0f4c2f5376c.
2024-07-19 11:15:15 -07:00
George Xu
2d9518a2ed add check 2024-07-19 11:15:15 -07:00
George Xu
cc9b2380ab kick ci 2024-07-19 11:15:15 -07:00
George Xu
e3545d43ff fix copypaste mistake 2024-07-19 11:15:15 -07:00
George Xu
b9a7ab770d fix: workaround_frame_eviction_bug 2024-07-19 11:15:15 -07:00
2 changed files with 48 additions and 0 deletions

View File

@@ -130,3 +130,5 @@ fix_font_face_resolution_when_renderer_is_blocked.patch
feat_enable_passing_exit_code_on_service_process_crash.patch
chore_remove_reference_to_chrome_browser_themes.patch
feat_enable_customizing_symbol_color_in_framecaptionbutton.patch
x11_use_localized_display_label_only_for_browser_process.patch
fix_workaround_frame_eviction_bug.patch

View File

@@ -0,0 +1,46 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: George Xu <george.xu@slack-corp.com>
Date: Mon, 24 Jun 2024 15:07:24 -0700
Subject: fix: workaround frame eviction bug
Electron window contents are disappearing after several minutes when using the background throttling feature on Windows.
This is due to a bug in `disable_hidden.patch`- a detailed writeup can be found in the linked issue.
https://github.com/electron/electron/issues/42378
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 2db3239303d59677384cfb6eeb5cdd101c7d6d5c..f82ddb44196a70d79af933cb6ad826b8323cd5ce 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -570,7 +570,7 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
// OnShowWithPageVisibility will not call NotifyHostAndDelegateOnWasShown,
// which updates `visibility_`, unless the host is hidden. Make sure no update
// is needed.
- if (host_->is_hidden() || visibility_ == Visibility::VISIBLE)
+ if (host_->is_hidden() || host()->disable_hidden_ || visibility_ == Visibility::VISIBLE)
OnShowWithPageVisibility(page_visibility);
}
@@ -588,7 +588,7 @@ void RenderWidgetHostViewAura::EnsurePlatformVisibility(
void RenderWidgetHostViewAura::NotifyHostAndDelegateOnWasShown(
blink::mojom::RecordContentToVisibleTimeRequestPtr tab_switch_start_state) {
CHECK(delegated_frame_host_) << "Cannot be invoked during destruction.";
- CHECK(host_->is_hidden());
+ CHECK(host_->is_hidden() || host()->disable_hidden_);
CHECK_NE(visibility_, Visibility::VISIBLE);
visibility_ = Visibility::VISIBLE;
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index ad42e2d94ab498dd30968e62aebd62e14f8161ab..66623189c7ad951646d49d7619b63bbb2a35036d 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -1132,7 +1132,7 @@ void RenderWidgetHostViewBase::OnShowWithPageVisibility(
const bool web_contents_is_visible =
page_visibility == PageVisibilityState::kVisible;
- if (host_->is_hidden()) {
+ if (host_->is_hidden() || host()->disable_hidden_) {
// If the WebContents is becoming visible, ask the compositor to report the
// visibility time for metrics. Otherwise the widget is being rendered even
// though the WebContents is hidden or occluded, for example due to being