Skip to content

Commit

Permalink
add app_id to bevy_window::Window
Browse files Browse the repository at this point in the history
  • Loading branch information
VitalyAnkh committed Feb 13, 2023
1 parent f7fbfaf commit 8569e8a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/bevy_window/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ pub struct Window {
pub resolution: WindowResolution,
/// Stores the title of the window.
pub title: String,
/// Stores the application ID of the window.
pub app_id: String,
/// How the alpha channel of textures should be handled while compositing.
pub composite_alpha_mode: CompositeAlphaMode,
/// Which size limits to give the window.
Expand Down Expand Up @@ -191,6 +193,7 @@ impl Default for Window {
fn default() -> Self {
Self {
title: "Bevy App".to_owned(),
app_id: "Bevy.App".to_owned(),
cursor: Default::default(),
present_mode: Default::default(),
mode: Default::default(),
Expand Down
15 changes: 15 additions & 0 deletions crates/bevy_winit/src/winit_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ impl WinitWindows {
.with_decorations(window.decorations)
.with_transparent(window.transparent);

#[cfg(feature = "wayland")]
use winit::platform::wayland::WindowBuilderExtWayland;
winit_window_builder = winit::platform::wayland::WindowBuilderExtWayland::with_name(
winit_window_builder,
window.app_id.clone(),
"",
);

#[cfg(feature = "x11")]
winit_window_builder = winit::platform::x11::WindowBuilderExtX11::with_name(
winit_window_builder,
window.app_id.clone(),
"",
);

let constraints = window.resize_constraints.check_constraints();
let min_inner_size = LogicalSize {
width: constraints.min_width,
Expand Down

0 comments on commit 8569e8a

Please sign in to comment.