Skip to content

Commit

Permalink
Fix transparent_window example on wayland (#15262)
Browse files Browse the repository at this point in the history
Wayland only supports pre-multiplied alpha. Behavior on X11 seems
unchanged.

# Objective

- Fix #10929 on wayland.

## Solution

- Request pre-multiplied alpha.

## Testing

- Ran the example locally.
  • Loading branch information
mahkoh authored Oct 6, 2024
1 parent e7c1c99 commit f37f5fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/window/transparent_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! for more details.

use bevy::prelude::*;
#[cfg(target_os = "macos")]
#[cfg(any(target_os = "macos", target_os = "linux"))]
use bevy::window::CompositeAlphaMode;

fn main() {
Expand All @@ -18,6 +18,8 @@ fn main() {
decorations: false,
#[cfg(target_os = "macos")]
composite_alpha_mode: CompositeAlphaMode::PostMultiplied,
#[cfg(target_os = "linux")]
composite_alpha_mode: CompositeAlphaMode::PreMultiplied,
..default()
}),
..default()
Expand Down

0 comments on commit f37f5fd

Please sign in to comment.