When using multiple canvas, an error is displayed
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
bevy: 0.14.2
When using multiple windows on the WEBGL platform, the rendering position of the non-main window is displayed incorrectly, but WEBGPU is normal
## What you did
my code :
let second_window = commands
.spawn((
Window {
title: "xxx".to_owned(),
canvas: Some(canvas_id),
transparent: true,
composite_alpha_mode: if adapter.backend == wgpu_types::Backend::Gl
{
bevy::window::CompositeAlphaMode::default()
} else {
bevy::window::CompositeAlphaMode::PreMultiplied
},
fit_canvas_to_parent: false,
..default()
},
))
.id();
let second_window_camera = commands
.spawn((
Camera3dBundle {
tonemapping: Tonemapping::None,
camera: Camera {
target: RenderTarget::Window(WindowRef::Entity(second_window)),
..default()
},
..default()
},
))
.id();
## What went wrong
The second window is not displayed on the canvas

Contributor guide
Research direction
Start from the reported multiple-window setup using Window with a canvas and Camera targeting RenderTarget::Window(WindowRef::Entity(second_window)). Compare the WebGL path, including CompositeAlphaMode::default(), with the working WebGPU path. Done means the second window is displayed at the correct position on its canvas under WebGL without regressing WebGPU.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100