From ffb46dd61f5979f0870b3240ad72d33afd622171 Mon Sep 17 00:00:00 2001 From: Neil Macneale V Date: Mon, 25 Sep 2023 14:05:15 -0700 Subject: [PATCH] Fix transparent windows on X11 --- src/platform_impl/linux/x11/window.rs | 2 +- src/window.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform_impl/linux/x11/window.rs b/src/platform_impl/linux/x11/window.rs index 8fc37311..946bf24f 100644 --- a/src/platform_impl/linux/x11/window.rs +++ b/src/platform_impl/linux/x11/window.rs @@ -242,7 +242,7 @@ impl UnownedWindow { // Find a suitable visual, true color with 32 bits of depth. all_visuals .find_map(|(visual, depth)| { - (visual.class == xproto::VisualClass::TRUE_COLOR) + (depth == 32 && visual.class == xproto::VisualClass::TRUE_COLOR) .then_some((Some(visual), depth, true)) }) .unwrap_or_else(|| { diff --git a/src/window.rs b/src/window.rs index 38f79c6f..81cbaf40 100644 --- a/src/window.rs +++ b/src/window.rs @@ -875,7 +875,8 @@ impl Window { /// /// ## Platform-specific /// - /// - **Windows / X11 / Web / iOS / Android / Orbital:** Unsupported. + /// - **Windows / Web / iOS / Android / Orbital:** Unsupported. + /// - **X11:** Can only be set while building the window, with [`WindowBuilder::with_transparent`]. #[inline] pub fn set_transparent(&self, transparent: bool) { self.window