electron/patches/chromium/fix_partially_revert_invalidate_focusring.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
2.1 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: VerteDinde <keeleymhammond@gmail.com>
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 4116b2a3fad02e1060bb7b137804753cf97dd7ca..46d3b426f54041efe4270bfda453358418fff160 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -928,16 +928,6 @@ void View::Layout(PassKey) {
}
void View::InvalidateLayout() {
- if (invalidating_) {
- return;
- }
-
- // There is no need to `InvalidateLayout()` when `Widget::IsClosed()`.
- if (Widget* widget = GetWidget(); widget && widget->IsClosed()) {
- return;
- }
-
- base::AutoReset<bool> invalidating(&invalidating_, true);
// We should never need to invalidate during a layout call; this tracks
// how many times that is happening.
++invalidates_during_layout_;
@@ -945,11 +935,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 8f377e417231698b9146d5b79dc14730e34260f7..9936899e10505f57d3b465d5613d90df8d18ded3 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -2339,9 +2339,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<LayoutManager> layout_manager_;