-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create multiple windows in multiple monitors? #7600
Comments
Hi, @Aceeri , could you give a look at this? I can put second window on second monitor when using bevy 0.9.1. I'm not sure if windows as entities pr breaks this or something I missed. |
I'll double check that this works, never really tested it specifically myself just took existing code. |
Hmm, it seems to work fine on Windows. I do have a M1 laptop to try and test this on, but I'll try doing that tomorrow. |
@lewiszlw Would you mind posting the logs from running the code with position: WindowPosition::Centered(MonitorSelection::Index(1)), ? Just wondering if there is maybe a WARN about it not finding the second monitor. |
|
Works for me on Linux (X11) too. |
@lewiszlw Would you be open to debugging this further on your end? Can ask me any questions about the windowing code in general. Could also do it live somewhere if you think that'd be helpful. |
Sure, I'll try a deep dive. |
I have some findings @Aceeri
Seems the process behind creating primary window on second monitor will init somthing for the second monitor. |
Hmm, this makes me think we either are or aren't flipping the coordinate space for position in the y direction. Either way our vertical coordinate space is differing from winits I think. |
I tried winit multiwindow example, everything works fine. |
There are some talk in #6526, maybe helpful. |
Can't seem to repro this still, tried moving my monitors around to be in a similar set up but it seems to work fine hmm |
I've run into the same problem on bevy 0.12.0 SystemInfo { os: "MacOS 14.1.1 ", kernel: "23.1.0", cpu: "Apple M1 Pro", core_count: "8", memory: "16.0 GiB" } AdapterInfo { name: "Apple M1 Pro", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal } |
@lewiszlw, how were you able to get the primary window to be constructed on a secondary monitor?
always results in the window being on the primary display, no matter which index is used. |
I think the method is like you pasted, setting |
@DrewRidley Did you manage to get the window to show up on the second monitor? This configuration is still not working on M1 Mac:
No matter what the value of the index, the window only shows up on the primary display. |
This is also an issue for me. M3 Macbook Like, I may be editing on terminal 0 on monitor 0. The game opens up on monitor 0. |
@RockyGitHub
Then you can iterate the vector of display ids and call
Now all you need is iterate the current list of monitors in monitor selection and check if any window
Hope it will help someone |
Hi @arahisman , this looks very promising but I can't seem to find where the |
Hi! This functionality was added in the new version of bevy 0.15.x. Here's a code example from my application for ar-glasses:
WindowState is the resource that contains a window entity
fn setup:
|
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 triedand
What went wrong
The second window is always on my primary monitor.
The text was updated successfully, but these errors were encountered: