/
allow_nested_error_trackers.patch
34 lines (32 loc) · 1.59 KB
/
allow_nested_error_trackers.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <charles@charleskerr.com>
Date: Thu, 20 Sep 2018 17:50:17 -0700
Subject: allow_nested_error_trackers.patch
Only one X11ErrorTracker should exist at a time, but upstream has a bug
where two can exist if running in headless mode --
ui::(anonymous namespace)::SupportsEWMH() [inner tracker is created]
ui::WmSupportsHint()
ui::IsX11WindowFullScreen()
ui::ScreensaverWindowFinder::IsScreensaverWindow()
ui::ScreensaverWindowFinder::ShouldStopIterating()
ui::EnumerateTopLevelWindows()
ui::ScreensaverWindowFinder::ScreensaverWindowExists() [outer tracker created]
ui::CheckIdleStateIsLocked()
ui::CalculateIdleState()
Removal of either tracker could have side-effects in some code paths,
so this is probably better handled upstream. This patch tries to do the
least harm in the interim by removing the check that prevents more than
one tracker from existing at a time.
diff --git a/ui/gfx/x/x11_error_tracker.cc b/ui/gfx/x/x11_error_tracker.cc
index 2e6addccf11ae33de6b4bb1de0a921deff36dd9d..59742930aa1eb488568068a3a4f1c4127a1ca18f 100644
--- a/ui/gfx/x/x11_error_tracker.cc
+++ b/ui/gfx/x/x11_error_tracker.cc
@@ -25,7 +25,7 @@ namespace gfx {
X11ErrorTracker::X11ErrorTracker() {
// This is a non-exhaustive check for incorrect usage. It disallows nested
// X11ErrorTracker instances on the same thread.
- DCHECK(g_handler == nullptr);
+ // DCHECK(g_handler == nullptr);
g_handler = this;
XSync(GetXDisplay(), x11::False);
old_handler_ = reinterpret_cast<void*>(XSetErrorHandler(X11ErrorHandler));