feat: fix Windows flashing, UI thread blocking, and idle redraws (fixes #90)

This commit is contained in:
TomZz
2026-07-22 23:58:17 +08:00
parent e7ca7bdc23
commit 3b9ee02cce
8 changed files with 233 additions and 123 deletions
+12 -14
View File
@@ -1425,9 +1425,7 @@ impl Ashell {
this.recording_action = None;
this.keybind_error = None;
this.config.set_key_binding(&action, &new_key);
if let Err(err) = this.config.save() {
tracing::error!("failed to save key binding: {err:#}");
}
this.save_preferences_background();
cx.notify();
});
}
@@ -1600,7 +1598,7 @@ impl Ashell {
.checked(current_style == crate::session::config::TitleBarStyle::Native)
.on_click(window.listener_for(&view, |this, _, _, cx| {
this.config.set_title_bar_style(crate::session::config::TitleBarStyle::Native);
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
)
@@ -1609,7 +1607,7 @@ impl Ashell {
.checked(current_style == crate::session::config::TitleBarStyle::Integrated)
.on_click(window.listener_for(&view, |this, _, _, cx| {
this.config.set_title_bar_style(crate::session::config::TitleBarStyle::Integrated);
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
);
@@ -1844,7 +1842,7 @@ impl Ashell {
.checked(view.read(cx).config.right_click_copy_paste())
.on_click(window.listener_for(&view, |this, checked, _, cx| {
this.config.set_right_click_copy_paste(*checked);
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
.into_any_element()
@@ -1863,7 +1861,7 @@ impl Ashell {
.checked(view.read(cx).config.keyword_highlight())
.on_click(window.listener_for(&view, |this, checked, _, cx| {
this.config.set_keyword_highlight(*checked);
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
.into_any_element()
@@ -1882,7 +1880,7 @@ impl Ashell {
.checked(view.read(cx).config.lock_layout())
.on_click(window.listener_for(&view, |this, checked, _, cx| {
this.config.set_lock_layout(*checked);
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
.into_any_element()
@@ -1919,7 +1917,7 @@ impl Ashell {
.checked(pos == "Bottom")
.on_click(window.listener_for(&view, |this, _, _window, cx| {
this.config.set_monitoring_position("Bottom");
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
)
@@ -1928,7 +1926,7 @@ impl Ashell {
.checked(pos == "Sidebar")
.on_click(window.listener_for(&view, |this, _, _window, cx| {
this.config.set_monitoring_position("Sidebar");
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
)
@@ -1937,7 +1935,7 @@ impl Ashell {
.checked(pos == "Hidden")
.on_click(window.listener_for(&view, |this, _, _window, cx| {
this.config.set_monitoring_position("Hidden");
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
);
@@ -2109,7 +2107,7 @@ impl Ashell {
.checked(view.read(cx).config.use_proxy())
.on_click(window.listener_for(&view, |this, checked, _, cx| {
this.config.set_use_proxy(*checked);
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
.into_any_element()
@@ -2128,7 +2126,7 @@ impl Ashell {
.checked(view.read(cx).config.read_env_proxy())
.on_click(window.listener_for(&view, |this, checked, _, cx| {
this.config.set_read_env_proxy(*checked);
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
.into_any_element()
@@ -2197,7 +2195,7 @@ impl Ashell {
this.config.set_global_proxy_port(port);
this.config.set_global_proxy_user(user);
this.config.set_global_proxy_password(password);
let _ = this.config.save();
this.save_preferences_background();
cx.notify();
}))
)