From 69001c6546a55c57b9a270a6f4bfc7926461d9bf Mon Sep 17 00:00:00 2001 From: Federico Terzi Date: Sun, 8 Mar 2020 20:17:47 +0100 Subject: [PATCH] Move the incompatible backend warning --- src/config/mod.rs | 5 +++++ src/engine.rs | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index 180566e..8acf48d 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -326,6 +326,11 @@ impl ConfigSet { let default_file = config_dir.join(DEFAULT_CONFIG_FILE_NAME); let default = Configs::load_config(default_file.as_path())?; + // Check that a compatible backend is used, otherwise warn the user + if cfg!(not(target_os = "linux")) && default.backend == BackendType::Auto { + eprintln!("Warning: Using Auto backend is only supported on Linux, falling back to Inject backend."); + } + // Analyze which config files has to be loaded let mut target_files = Vec::new(); diff --git a/src/engine.rs b/src/engine.rs index 8f7d298..3d69476 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -200,7 +200,6 @@ impl <'a, S: KeyboardManager, C: ClipboardManager, M: ConfigManager<'a>, U: UIMa &BackendType::Clipboard } }else{ - warn!("Using Auto backend is only supported on Linux, falling back to Inject backend."); &BackendType::Inject } }else{