From 5d98148b032fc49f2e49d8452b51a6358a698fcd Mon Sep 17 00:00:00 2001 From: Benjamin Davies Date: Tue, 13 Apr 2021 08:09:37 +1200 Subject: [PATCH] Don't call `.vulkan()` when building the SDL window on macOS (#541) This appears to fix some (not all) of the problems that are mentioned in #466 --- src/window/sdl2/mod.rs | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/window/sdl2/mod.rs b/src/window/sdl2/mod.rs index 24943ce..3450348 100644 --- a/src/window/sdl2/mod.rs +++ b/src/window/sdl2/mod.rs @@ -432,14 +432,25 @@ pub fn start_loop( .expect("Failed to create sdl video subsystem"); video_subsystem.text_input().start(); - let mut sdl_window = video_subsystem - .window("Neovide", logical_size.width, logical_size.height) - .position_centered() - .allow_highdpi() - .resizable() - .vulkan() - .build() - .expect("Failed to create window"); + let mut sdl_window = if cfg!(target_os = "macos") { + video_subsystem + .window("Neovide", logical_size.width, logical_size.height) + .position_centered() + .allow_highdpi() + .resizable() + // .vulkan() call emited as it causes errors on some systems + .build() + .expect("Failed to create window") + } else { + video_subsystem + .window("Neovide", logical_size.width, logical_size.height) + .position_centered() + .allow_highdpi() + .resizable() + .vulkan() + .build() + .expect("Failed to create window") + }; log::info!("window created"); set_icon(&mut sdl_window);