From 1f3a37bc7ca66f6c27606e2eea561aa60c69571a Mon Sep 17 00:00:00 2001 From: StudentWeis Date: Sun, 4 Jan 2026 23:33:39 +0800 Subject: [PATCH 1/2] fix: clean up auto-start manager logic in windows --- .gitignore | 1 + src/config/autostart.rs | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0592392..e747356 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target .DS_Store +/.vscode diff --git a/src/config/autostart.rs b/src/config/autostart.rs index f381d90..458ad99 100644 --- a/src/config/autostart.rs +++ b/src/config/autostart.rs @@ -86,7 +86,6 @@ impl AutoStartManager { } /// Check if auto-start is currently enabled - #[allow(dead_code)] pub fn is_enabled(&self) -> Result { self.auto_launch .is_enabled() @@ -98,10 +97,15 @@ impl AutoStartManager { /// # Arguments /// * `enabled` - Whether auto-start should be enabled pub fn sync_state(&self, enabled: bool) -> Result<(), AutoStartError> { - if enabled { - self.enable() + let current_enabled = self.is_enabled().unwrap_or(false); + if current_enabled != enabled { + if enabled { + self.enable() + } else { + self.disable() + } } else { - self.disable() + Ok(()) } } } From 965ab461ff6aa39981236e267bf4959a4439a28f Mon Sep 17 00:00:00 2001 From: StudentWeis Date: Mon, 5 Jan 2026 00:05:27 +0800 Subject: [PATCH 2/2] fix: handle settings exit in hide action --- src/gui/board/actions.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gui/board/actions.rs b/src/gui/board/actions.rs index 26c68e7..a42b0a0 100644 --- a/src/gui/board/actions.rs +++ b/src/gui/board/actions.rs @@ -44,6 +44,20 @@ impl RopyBoard { } pub fn on_hide_action(&mut self, _: &Hide, window: &mut Window, cx: &mut Context) { + // If still in settings, exit settings view and refocus main board instead of hiding + if self.show_settings { + self.show_settings = false; + self.settings_max_history_input.update(cx, |input, cx| { + input.set_value("", window, cx); + }); + self.settings_activation_key_input.update(cx, |input, cx| { + input.set_value("", window, cx); + }); + window.focus(&self.focus_handle); + cx.notify(); + return; + } + // If the search input is focused, return focus to the main component before hiding if let Some(focused_handle) = window.focused(cx) && focused_handle == self.search_input.focus_handle(cx)