bevyengine / bevyengine/bevy

How to create multiple windows in multiple monitors?

Open
#7,600 21 comments 0 reactions 0 assignees View on GitHub
A-Windowing C-Bug O-MacOS S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

main branch (lastest commit is `cd447fb4e68716fb908158ab9ca64d13746a6b97`).

## \[Optional\] Relevant system information

AdapterInfo { name: "Apple M1", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }

SystemInfo { os: "MacOS 13.0 ", kernel: "22.1.0", cpu: "Apple M1", core_count: "8", memory: "16.0 GiB" }

[DisplayInfo { id: 1, x: 0, y: 0, width: 1440, height: 900, rotation: 0.0, scale_factor: 2.0, is_primary: true }, DisplayInfo { id: 2, x: -264, y: -1080, width: 1920, height: 1080, rotation: 0.0, scale_factor: 1.0, is_primary: false }]

## What you did

I'm trying to run offical example `multiple_windows` and want second window putted on second monitor. I tried
```
let second_window = commands
.spawn(Window {
title: "Second window".to_owned(),
position: WindowPosition::At(IVec2::new(-264, -1080)),
resolution: WindowResolution::new(1920., 1080.),
..default()
})
.id();
```
and
```
let second_window = commands
.spawn(Window {
title: "Second window".to_owned(),
position: WindowPosition::Centered(MonitorSelection::Index(1)), // I tried 0,1,2,3 here
resolution: WindowResolution::new(1920., 1080.),
..default()
})
.id();
```

## What went wrong

The second window is always on my primary monitor.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.