-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x11: Allow overriding default X visuals
Otherwise, it crashes with recent GTK+ 3 versions. Signed-off-by: Jiří Janoušek <[email protected]>
- Loading branch information
1 parent
2c8185d
commit e57798f
Showing
4 changed files
with
65 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
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
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
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,36 @@ | ||
diff --git ui/base/x/x11_util.cc ui/base/x/x11_util.cc | ||
index dbb8cc534e30..2f79de19b128 100644 | ||
--- ui/base/x/x11_util.cc | ||
+++ ui/base/x/x11_util.cc | ||
@@ -1403,6 +1403,14 @@ XVisualManager::XVisualManager() | ||
DCHECK(visuals_.find(transparent_visual_id_) != visuals_.end()); | ||
} | ||
|
||
+void XVisualManager::OverrideSystemVisual(VisualID visual_id) { | ||
+ system_visual_id_ = visual_id; | ||
+} | ||
+ | ||
+void XVisualManager::OverrideTransparentVisual(VisualID visual_id) { | ||
+ transparent_visual_id_ = visual_id; | ||
+} | ||
+ | ||
XVisualManager::~XVisualManager() {} | ||
|
||
void XVisualManager::ChooseVisualForWindow(bool want_argb_visual, | ||
diff --git ui/base/x/x11_util_internal.h ui/base/x/x11_util_internal.h | ||
index 100d215f6a0d..44c430acc168 100644 | ||
--- ui/base/x/x11_util_internal.h | ||
+++ ui/base/x/x11_util_internal.h | ||
@@ -80,6 +80,12 @@ class UI_BASE_X_EXPORT XVisualManager { | ||
|
||
// Are all of the system requirements met for using transparent visuals? | ||
bool ArgbVisualAvailable() const; | ||
+ | ||
+ // Set a different system visual. | ||
+ void OverrideSystemVisual(VisualID visual_id); | ||
+ | ||
+ // Set a different transparent visual. | ||
+ void OverrideTransparentVisual(VisualID visual_id); | ||
|
||
~XVisualManager(); | ||
|