mirror of
https://github.com/encounter/objdiff.git
synced 2025-06-07 23:23:34 +00:00
More fixes
This commit is contained in:
parent
7bcbfd7bc0
commit
d5e157545d
@ -200,12 +200,14 @@ impl eframe::App for App {
|
|||||||
|
|
||||||
// Windows + request_repaint_after breaks dialogs:
|
// Windows + request_repaint_after breaks dialogs:
|
||||||
// https://github.com/emilk/egui/issues/2003
|
// https://github.com/emilk/egui/issues/2003
|
||||||
if cfg!(windows) || view_state.jobs.iter().any(|job| {
|
if cfg!(windows)
|
||||||
|
|| view_state.jobs.iter().any(|job| {
|
||||||
if let Some(handle) = &job.handle {
|
if let Some(handle) = &job.handle {
|
||||||
return !handle.is_finished();
|
return !handle.is_finished();
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}) {
|
})
|
||||||
|
{
|
||||||
ctx.request_repaint();
|
ctx.request_repaint();
|
||||||
} else {
|
} else {
|
||||||
ctx.request_repaint_after(Duration::from_millis(100));
|
ctx.request_repaint_after(Duration::from_millis(100));
|
||||||
|
@ -30,15 +30,16 @@ fn run_make(cwd: &Path, arg: &Path, config: &AppConfig) -> BuildStatus {
|
|||||||
match (|| -> Result<BuildStatus> {
|
match (|| -> Result<BuildStatus> {
|
||||||
let make = if config.custom_make.is_empty() { "make" } else { &config.custom_make };
|
let make = if config.custom_make.is_empty() { "make" } else { &config.custom_make };
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
let mut command = {
|
||||||
let mut command = Command::new(make);
|
let mut command = Command::new(make);
|
||||||
command.current_dir(cwd).arg(arg);
|
command.current_dir(cwd).arg(arg);
|
||||||
command
|
command
|
||||||
}
|
};
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
let mut command = {
|
let mut command = {
|
||||||
use path_slash::PathExt;
|
|
||||||
use std::os::windows::process::CommandExt;
|
use std::os::windows::process::CommandExt;
|
||||||
|
|
||||||
|
use path_slash::PathExt;
|
||||||
let mut command = if config.selected_wsl_distro.is_some() {
|
let mut command = if config.selected_wsl_distro.is_some() {
|
||||||
Command::new("wsl")
|
Command::new("wsl")
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
use std::process::Command;
|
#[cfg(windows)]
|
||||||
use std::string::FromUtf16Error;
|
use std::string::FromUtf16Error;
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -20,7 +21,7 @@ fn process_utf16(bytes: &[u8]) -> Result<String, FromUtf16Error> {
|
|||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
fn wsl_cmd(args: &[&str]) -> Result<String> {
|
fn wsl_cmd(args: &[&str]) -> Result<String> {
|
||||||
use std::os::windows::process::CommandExt;
|
use std::{os::windows::process::CommandExt, process::Command};
|
||||||
let output = Command::new("wsl")
|
let output = Command::new("wsl")
|
||||||
.args(args)
|
.args(args)
|
||||||
.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW)
|
.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW)
|
||||||
@ -73,6 +74,11 @@ pub fn config_ui(ui: &mut egui::Ui, config: &Arc<RwLock<AppConfig>>, view_state:
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
{
|
||||||
|
let _ = available_wsl_distros;
|
||||||
|
let _ = selected_wsl_distro;
|
||||||
|
}
|
||||||
|
|
||||||
ui.label("Custom make program:");
|
ui.label("Custom make program:");
|
||||||
ui.text_edit_singleline(custom_make);
|
ui.text_edit_singleline(custom_make);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user