Skip to content

Commit

Permalink
Fix winit breaking changes; default to x11, add wayland feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
tychedelia committed Oct 12, 2023
1 parent 1648fd4 commit 8726b22
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 16 additions & 1 deletion nannou/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,11 +779,26 @@ impl<'app> Builder<'app> {
target_os = "netbsd",
target_os = "openbsd"
))]
#[cfg(not(feature = "wayland"))]
{
use winit::platform::unix::WindowBuilderExtUnix;
use winit::platform::x11::WindowBuilderExtUnix;
window = window.with_class("nannou".to_string(), "nannou".to_string());
}

#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
#[cfg(feature = "wayland")]
{
use winit::platform::x11::WindowBuilderExtUnix;
window = window.with_class("nannou".to_string(), "nannou".to_string());
}


// Set default dimensions in the case that none were given.
let initial_window_size = window
.window_attributes()
Expand Down
3 changes: 3 additions & 0 deletions nannou_egui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ egui = "0.23"
eframe = "0.23"
winit = "0.28"
nannou = { version = "0.18.1", path = "../nannou" }

[features]
wayland = []

0 comments on commit 8726b22

Please sign in to comment.