diff --git a/src/app.rs b/src/app.rs index dec373f..b72ea23 100644 --- a/src/app.rs +++ b/src/app.rs @@ -200,12 +200,14 @@ impl eframe::App for App { // Windows + request_repaint_after breaks dialogs: // https://github.com/emilk/egui/issues/2003 - if cfg!(windows) || view_state.jobs.iter().any(|job| { - if let Some(handle) = &job.handle { - return !handle.is_finished(); - } - false - }) { + if cfg!(windows) + || view_state.jobs.iter().any(|job| { + if let Some(handle) = &job.handle { + return !handle.is_finished(); + } + false + }) + { ctx.request_repaint(); } else { ctx.request_repaint_after(Duration::from_millis(100)); diff --git a/src/jobs/build.rs b/src/jobs/build.rs index 7dd0444..d633d12 100644 --- a/src/jobs/build.rs +++ b/src/jobs/build.rs @@ -30,15 +30,16 @@ fn run_make(cwd: &Path, arg: &Path, config: &AppConfig) -> BuildStatus { match (|| -> Result { let make = if config.custom_make.is_empty() { "make" } else { &config.custom_make }; #[cfg(not(windows))] - { + let mut command = { let mut command = Command::new(make); command.current_dir(cwd).arg(arg); command - } + }; #[cfg(windows)] let mut command = { - use path_slash::PathExt; use std::os::windows::process::CommandExt; + + use path_slash::PathExt; let mut command = if config.selected_wsl_distro.is_some() { Command::new("wsl") } else { diff --git a/src/views/config.rs b/src/views/config.rs index d5e566a..041c446 100644 --- a/src/views/config.rs +++ b/src/views/config.rs @@ -1,7 +1,8 @@ -use std::process::Command; +#[cfg(windows)] use std::string::FromUtf16Error; use std::sync::{Arc, RwLock}; +#[cfg(windows)] use anyhow::{Context, Result}; use crate::{ @@ -20,7 +21,7 @@ fn process_utf16(bytes: &[u8]) -> Result { #[cfg(windows)] fn wsl_cmd(args: &[&str]) -> Result { - use std::os::windows::process::CommandExt; + use std::{os::windows::process::CommandExt, process::Command}; let output = Command::new("wsl") .args(args) .creation_flags(winapi::um::winbase::CREATE_NO_WINDOW) @@ -73,6 +74,11 @@ pub fn config_ui(ui: &mut egui::Ui, config: &Arc>, view_state: } }); } + #[cfg(not(windows))] + { + let _ = available_wsl_distros; + let _ = selected_wsl_distro; + } ui.label("Custom make program:"); ui.text_edit_singleline(custom_make);