From de2279599e3b44eec966b51aa375fd5c5fb504e8 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 11:28:15 -0700 Subject: [PATCH] fix: partially revert invalidate focus ring (#42145) * fix: partially revert invalidate focus ring Co-authored-by: VerteDinde * chore: resolve patch after backport --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: VerteDinde Co-authored-by: Keeley Hammond --- patches/chromium/.patches | 1 + ...artially_revert_invalidate_focusring.patch | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 patches/chromium/fix_partially_revert_invalidate_focusring.patch diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 6bf7ccda7b6..190c79ac784 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -132,3 +132,4 @@ fix_add_support_for_skipping_first_2_no-op_refreshes_in_thumb_cap.patch refactor_expose_file_system_access_blocklist.patch cherry-pick-013961609785.patch feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch +fix_partially_revert_invalidate_focusring.patch diff --git a/patches/chromium/fix_partially_revert_invalidate_focusring.patch b/patches/chromium/fix_partially_revert_invalidate_focusring.patch new file mode 100644 index 00000000000..2d4af402f5e --- /dev/null +++ b/patches/chromium/fix_partially_revert_invalidate_focusring.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: VerteDinde +Date: Mon, 6 May 2024 11:03:08 -0700 +Subject: fix: partially revert views invalidate FocusRing when its host is + invalidated + +This reverts commit f425c438dfb11fb714655c999ba8c74b58393425. This +commit seems to be causing a sporadic crash on Ubuntu and other Linux +distros. This patch can be reverted when the issue is fixed upstream, or +when the crash is addressed. + +diff --git a/ui/views/view.cc b/ui/views/view.cc +index 81109f7679aaef16f3045f61e349af42e7464a03..c734f8522d2912210f04ecb8f2bba2f904c53535 100644 +--- a/ui/views/view.cc ++++ b/ui/views/view.cc +@@ -929,11 +929,6 @@ void View::Layout(PassKey) { + } + + void View::InvalidateLayout() { +- if (invalidating_) { +- return; +- } +- +- base::AutoReset invalidating(&invalidating_, true); + // We should never need to invalidate during a layout call; this tracks + // how many times that is happening. + ++invalidates_during_layout_; +@@ -941,11 +936,6 @@ void View::InvalidateLayout() { + // Always invalidate up. This is needed to handle the case of us already being + // valid, but not our parent. + needs_layout_ = true; +- +- for (ViewObserver& observer : observers_) { +- observer.OnViewLayoutInvalidated(this); +- } +- + if (HasLayoutManager()) { + GetLayoutManager()->InvalidateLayout(); + } +diff --git a/ui/views/view.h b/ui/views/view.h +index 6cca6e9e7627d8495128d42887b0c950ee85d1d7..69ab9fa2b82848fdf49d8cf099ddad224460312a 100644 +--- a/ui/views/view.h ++++ b/ui/views/view.h +@@ -2350,9 +2350,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, + // it is happening. + int invalidates_during_layout_ = 0; + +- // Whether this view is in the middle of InvalidateLayout(). +- bool invalidating_ = false; +- + // The View's LayoutManager defines the sizing heuristics applied to child + // Views. The default is absolute positioning according to bounds_. + std::unique_ptr layout_manager_;