mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 14:50:04 -04:00
Fix transparent windows on X11
This commit is contained in:
@@ -242,7 +242,7 @@ impl UnownedWindow {
|
|||||||
// Find a suitable visual, true color with 32 bits of depth.
|
// Find a suitable visual, true color with 32 bits of depth.
|
||||||
all_visuals
|
all_visuals
|
||||||
.find_map(|(visual, depth)| {
|
.find_map(|(visual, depth)| {
|
||||||
(visual.class == xproto::VisualClass::TRUE_COLOR)
|
(depth == 32 && visual.class == xproto::VisualClass::TRUE_COLOR)
|
||||||
.then_some((Some(visual), depth, true))
|
.then_some((Some(visual), depth, true))
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
|
|||||||
@@ -875,7 +875,8 @@ impl Window {
|
|||||||
///
|
///
|
||||||
/// ## Platform-specific
|
/// ## 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]
|
#[inline]
|
||||||
pub fn set_transparent(&self, transparent: bool) {
|
pub fn set_transparent(&self, transparent: bool) {
|
||||||
self.window
|
self.window
|
||||||
|
|||||||
Reference in New Issue
Block a user