fix: disable auto-restore by default (fixes space consumption on valid Vietnamese)
Some checks are pending
Build & Release / Build & test (push) Waiting to run
Build & Release / Build .deb (push) Blocked by required conditions

This commit is contained in:
Khoa Vo 2026-07-01 13:11:51 +07:00
parent 63c495894e
commit 36a6426894
2 changed files with 3 additions and 3 deletions

View file

@ -324,7 +324,7 @@ fn run_as_user(program: &str) -> std::process::Command {
use std::os::unix::process::CommandExt; use std::os::unix::process::CommandExt;
let mut cmd = std::process::Command::new(program); let mut cmd = std::process::Command::new(program);
cmd.uid(uid).gid(u32::MAX); cmd.uid(uid).gid(u32::MAX);
// Preserve display env vars for the user's session if let Ok(v) = std::env::var("HOME") { cmd.env("HOME", &v); }
if let Ok(v) = std::env::var("DISPLAY") { cmd.env("DISPLAY", v); } if let Ok(v) = std::env::var("DISPLAY") { cmd.env("DISPLAY", v); }
if let Ok(v) = std::env::var("WAYLAND_DISPLAY") { cmd.env("WAYLAND_DISPLAY", v); } if let Ok(v) = std::env::var("WAYLAND_DISPLAY") { cmd.env("WAYLAND_DISPLAY", v); }
if let Ok(v) = std::env::var("XDG_RUNTIME_DIR") { cmd.env("XDG_RUNTIME_DIR", v); } if let Ok(v) = std::env::var("XDG_RUNTIME_DIR") { cmd.env("XDG_RUNTIME_DIR", v); }

View file

@ -99,7 +99,7 @@ pub struct AppStateConfig {
impl Default for AutoRestoreConfig { impl Default for AutoRestoreConfig {
fn default() -> Self { fn default() -> Self {
Self { Self {
enabled: true, enabled: false,
trigger_keys: default_restore_keys(), trigger_keys: default_restore_keys(),
} }
} }
@ -348,7 +348,7 @@ vs = "với"
assert_eq!(config.input_method, "vni"); assert_eq!(config.input_method, "vni");
assert_eq!(config.toggle_key, "space"); assert_eq!(config.toggle_key, "space");
assert!(config.start_enabled); // default changed to true assert!(config.start_enabled); // default changed to true
assert!(config.auto_restore.enabled); assert!(!config.auto_restore.enabled);
assert!(config.app_state.enabled); assert!(config.app_state.enabled);
assert!(!config.app_state.english_apps.is_empty()); assert!(!config.app_state.english_apps.is_empty());
assert!(!config.app_state.vietnamese_apps.is_empty()); assert!(!config.app_state.vietnamese_apps.is_empty());