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

[Merged by Bors] - Apply WindowDescriptor settings in all modes #6934

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions crates/bevy_winit/src/winit_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,20 @@ impl WinitWindows {
window_descriptor.height as u32,
)),
)),
_ => {
WindowMode::Windowed => {
if let Some(sf) = scale_factor_override {
winit_window_builder.with_inner_size(logical_size.to_physical::<f64>(sf))
} else {
winit_window_builder.with_inner_size(logical_size)
}
}
};

winit_window_builder = winit_window_builder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's not an issue, but it seems to me like most of those settings simply won't do anything when not in windowed mode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

always_on_top and transparent work in all modes.
The resizable and decorations settings will still take effect if the window is switched to windowed mode later on.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, didn't think about switching mode, makes sense.

.with_resizable(window_descriptor.resizable)
.with_decorations(window_descriptor.decorations)
.with_transparent(window_descriptor.transparent)
.with_always_on_top(window_descriptor.always_on_top),
};
.with_always_on_top(window_descriptor.always_on_top);

let constraints = window_descriptor.resize_constraints.check_constraints();
let min_inner_size = LogicalSize {
Expand Down