forked from electron/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: partially revert invalidate focus ring (electron#42126)
- Loading branch information
1 parent
0410a38
commit 6fc2e3e
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
patches/chromium/fix_partially_revert_invalidate_focusring.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
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 94b026cda4738e489f1d7201c996f6db70d018ed..32ec794f4683be5ded78dcf310d3623b8748c236 100644 | ||
--- a/ui/views/view.cc | ||
+++ b/ui/views/view.cc | ||
@@ -911,16 +911,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_; | ||
@@ -928,11 +918,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 ea7d5441dbbfb713a6ffb57bcc07fb55fa574016..54b4c0a2871f214a4806fd863f32b8d010c09058 100644 | ||
--- a/ui/views/view.h | ||
+++ b/ui/views/view.h | ||
@@ -2343,9 +2343,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_; |