Skip to content

Commit

Permalink
Upgrade to winit 0.30 to fix android crash bevyengine/bevy#13331
Browse files Browse the repository at this point in the history
  • Loading branch information
maxammann committed Jul 3, 2024
1 parent e75bccf commit a1c8557
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rand = { version = "0.7.3", features = ["wasm-bindgen"] }
# FIXME: Untrusted dependency, 0.2.x doesn't compile with cache middleware
reqwest-middleware = "0.1.6"

winit = { version = "0.29.15", default-features = false, features = ["rwh_06"] }
winit = { version = "0.30", default-features = false, features = ["rwh_06"] }

#
# These dependencies should be updated to the latest version
Expand Down
12 changes: 5 additions & 7 deletions maplibre-winit/src/noweb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use maplibre::{
style::Style,
window::{MapWindow, MapWindowConfig, PhysicalSize},
};
use winit::window::WindowBuilder;
use winit::window::WindowAttributes;

use super::WinitMapWindow;
use crate::{WinitEnvironment, WinitEventLoop};
Expand Down Expand Up @@ -73,8 +73,7 @@ impl<ET: 'static + Clone> MapWindowConfig for WinitMapWindowConfig<ET> {
type MapWindow = WinitMapWindow<ET>;

fn create(&self) -> Self::MapWindow {
let mut raw_event_loop_builder =
winit::event_loop::EventLoopBuilder::<ET>::with_user_event();
let mut raw_event_loop_builder = winit::event_loop::EventLoop::<ET>::with_user_event();

#[cfg(target_os = "android")]
use winit::platform::android::EventLoopBuilderExtAndroid;
Expand All @@ -84,10 +83,9 @@ impl<ET: 'static + Clone> MapWindowConfig for WinitMapWindowConfig<ET> {

let raw_event_loop = raw_event_loop_builder.build().unwrap(); // TODO

let window = WindowBuilder::new()
.with_title(&self.title)
.build(&raw_event_loop)
.unwrap();
let window = raw_event_loop
.create_window(WindowAttributes::new().with_title(&self.title))
.unwrap(); // todo

Self::MapWindow {
window,
Expand Down

0 comments on commit a1c8557

Please sign in to comment.