Skip to content
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

winit ignores monitor selection in fullscreen #5875

Closed
djeedai opened this issue Sep 4, 2022 · 1 comment
Closed

winit ignores monitor selection in fullscreen #5875

djeedai opened this issue Sep 4, 2022 · 1 comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior

Comments

@djeedai
Copy link
Contributor

djeedai commented Sep 4, 2022

Bevy version

0.8.1

[Optional] Relevant system information

Windows 10

What you did

app.insert_resource(WindowDescriptor {
            mode: WindowMode::BorderlessFullscreen,
            position: WindowPosition::Centered(MonitorSelection::Number(42)),
            ..default()
        });

What went wrong

Primary monitor is always selected, no error whatever the monitor number asked (which obviously is nonsense in this example).

Additional information

Primary monitor is hard-coded here:

winit::window::Fullscreen::Borderless(event_loop.primary_monitor()),

WindowDescriptor::position (which contains the monitor ID) is only ever used when not in fullscreen.

@djeedai djeedai added C-Bug An unexpected or incorrect behavior A-Windowing Platform-agnostic interface layer to run your app in labels Sep 4, 2022
@bors bors bot closed this as completed in 28c16b9 Sep 6, 2022
nicopap pushed a commit to nicopap/bevy that referenced this issue Sep 12, 2022
# Objective
Support monitor selection for all window modes.
Fixes bevyengine#5875.

## Changelog

* Moved `MonitorSelection` out of `WindowPosition::Centered`, into `WindowDescriptor`.
* `WindowPosition::At` is now relative to the monitor instead of being in 'desktop space'.
* Renamed `MonitorSelection::Number` to `MonitorSelection::Index` for clarity.
* Added `WindowMode` to the prelude.
* `Window::set_position` is now relative to a monitor and takes a `MonitorSelection` as argument.

## Migration Guide

`MonitorSelection` was moved out of `WindowPosition::Centered`, into `WindowDescriptor`.
`MonitorSelection::Number` was renamed to `MonitorSelection::Index`.
```rust
// Before
.insert_resource(WindowDescriptor {
    position: WindowPosition::Centered(MonitorSelection::Number(1)),
    ..default()
})
// After
.insert_resource(WindowDescriptor {
    monitor: MonitorSelection::Index(1),
    position: WindowPosition::Centered,
    ..default()
})
```
`Window::set_position` now takes a `MonitorSelection` as argument.
```rust
window.set_position(MonitorSelection::Current, position);
```

Co-authored-by: devil-ira <justthecooldude@gmail.com>
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 28, 2022
# Objective
Support monitor selection for all window modes.
Fixes bevyengine#5875.

## Changelog

* Moved `MonitorSelection` out of `WindowPosition::Centered`, into `WindowDescriptor`.
* `WindowPosition::At` is now relative to the monitor instead of being in 'desktop space'.
* Renamed `MonitorSelection::Number` to `MonitorSelection::Index` for clarity.
* Added `WindowMode` to the prelude.
* `Window::set_position` is now relative to a monitor and takes a `MonitorSelection` as argument.

## Migration Guide

`MonitorSelection` was moved out of `WindowPosition::Centered`, into `WindowDescriptor`.
`MonitorSelection::Number` was renamed to `MonitorSelection::Index`.
```rust
// Before
.insert_resource(WindowDescriptor {
    position: WindowPosition::Centered(MonitorSelection::Number(1)),
    ..default()
})
// After
.insert_resource(WindowDescriptor {
    monitor: MonitorSelection::Index(1),
    position: WindowPosition::Centered,
    ..default()
})
```
`Window::set_position` now takes a `MonitorSelection` as argument.
```rust
window.set_position(MonitorSelection::Current, position);
```

Co-authored-by: devil-ira <justthecooldude@gmail.com>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective
Support monitor selection for all window modes.
Fixes bevyengine#5875.

## Changelog

* Moved `MonitorSelection` out of `WindowPosition::Centered`, into `WindowDescriptor`.
* `WindowPosition::At` is now relative to the monitor instead of being in 'desktop space'.
* Renamed `MonitorSelection::Number` to `MonitorSelection::Index` for clarity.
* Added `WindowMode` to the prelude.
* `Window::set_position` is now relative to a monitor and takes a `MonitorSelection` as argument.

## Migration Guide

`MonitorSelection` was moved out of `WindowPosition::Centered`, into `WindowDescriptor`.
`MonitorSelection::Number` was renamed to `MonitorSelection::Index`.
```rust
// Before
.insert_resource(WindowDescriptor {
    position: WindowPosition::Centered(MonitorSelection::Number(1)),
    ..default()
})
// After
.insert_resource(WindowDescriptor {
    monitor: MonitorSelection::Index(1),
    position: WindowPosition::Centered,
    ..default()
})
```
`Window::set_position` now takes a `MonitorSelection` as argument.
```rust
window.set_position(MonitorSelection::Current, position);
```

Co-authored-by: devil-ira <justthecooldude@gmail.com>
@djeedai
Copy link
Contributor Author

djeedai commented Apr 16, 2023

This was closed 6 months ago, but doesn't work on 0.10.1:

.set(WindowPlugin {
    primary_window: Some(Window {
        mode: WindowMode::BorderlessFullscreen, /* #5875 - does not work with
                                          * MonitorSelection */
        //mode: WindowMode::Windowed,
        position: WindowPosition::Centered(MonitorSelection::Index(1)),  //< doesn't do anything
        ..default()
    }),
    ..default()
}),

However the code on main seems to have changed again, so no idea if this needs reopen or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant