From 014757cfc918a352f7f3e9c11d5e50ece5477914 Mon Sep 17 00:00:00 2001 From: reya Date: Wed, 14 Jan 2026 15:00:52 +0700 Subject: [PATCH] chore: update gpui --- Cargo.lock | 100 ++++++++++++++++++++++------ crates/coop/src/actions.rs | 2 +- crates/state/src/lib.rs | 5 +- crates/ui/src/input/blink_cursor.rs | 7 +- 4 files changed, 87 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 088afc1..5192d4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + [[package]] name = "adler2" version = "2.0.1" @@ -97,7 +106,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0c269894b6fe5e9d7ada0cf69b5bf847ff35bc25fc271f08e1d080fce80339a" dependencies = [ - "object", + "object 0.32.2", ] [[package]] @@ -578,6 +587,21 @@ dependencies = [ "fs_extra", ] +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object 0.37.3", + "rustc-demangle", + "windows-link 0.2.1", +] + [[package]] name = "base64" version = "0.22.1" @@ -1155,7 +1179,7 @@ dependencies = [ [[package]] name = "collections" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "indexmap", "rustc-hash 2.1.1", @@ -1583,7 +1607,7 @@ dependencies = [ [[package]] name = "derive_refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "proc-macro2", "quote", @@ -2411,6 +2435,12 @@ dependencies = [ "weezl", ] +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + [[package]] name = "glob" version = "0.3.3" @@ -2487,7 +2517,7 @@ dependencies = [ [[package]] name = "gpui" version = "0.2.2" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "anyhow", "as-raw-xcb-connection", @@ -2503,6 +2533,7 @@ dependencies = [ "calloop", "calloop-wayland-source", "cbindgen", + "chrono", "circular-buffer", "cocoa 0.26.0", "cocoa-foundation 0.2.0", @@ -2518,7 +2549,6 @@ dependencies = [ "embed-resource", "etagere", "filedescriptor", - "flume", "foreign-types 0.5.0", "futures", "gpui_macros", @@ -2547,6 +2577,7 @@ dependencies = [ "raw-window-handle", "refineable", "resvg", + "scheduler", "schemars", "seahash", "semver", @@ -2588,7 +2619,7 @@ dependencies = [ [[package]] name = "gpui_macros" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -2599,7 +2630,7 @@ dependencies = [ [[package]] name = "gpui_tokio" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "anyhow", "gpui", @@ -2821,7 +2852,7 @@ dependencies = [ [[package]] name = "http_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "anyhow", "async-compression", @@ -2846,7 +2877,7 @@ dependencies = [ [[package]] name = "http_client_tls" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "rustls", "rustls-platform-verifier", @@ -3607,7 +3638,7 @@ dependencies = [ [[package]] name = "media" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "anyhow", "bindgen", @@ -4212,6 +4243,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.21.3" @@ -4458,7 +4498,7 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "perf" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "collections", "serde", @@ -5093,7 +5133,7 @@ dependencies = [ [[package]] name = "refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "derive_refineable", ] @@ -5192,7 +5232,7 @@ dependencies = [ [[package]] name = "reqwest_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "anyhow", "bytes", @@ -5246,7 +5286,7 @@ dependencies = [ [[package]] name = "rope" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "arrayvec", "log", @@ -5309,6 +5349,12 @@ dependencies = [ "ordered-multimap", ] +[[package]] +name = "rustc-demangle" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" + [[package]] name = "rustc-hash" version = "1.1.0" @@ -5516,6 +5562,20 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "scheduler" +version = "0.1.0" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" +dependencies = [ + "async-task", + "backtrace", + "chrono", + "flume", + "futures", + "parking_lot", + "rand 0.9.2", +] + [[package]] name = "schemars" version = "1.2.0" @@ -6095,7 +6155,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "sum_tree" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "arrayvec", "log", @@ -7053,7 +7113,7 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "util" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "anyhow", "async-fs", @@ -7089,7 +7149,7 @@ dependencies = [ [[package]] name = "util_macros" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "perf", "quote", @@ -8564,7 +8624,7 @@ dependencies = [ [[package]] name = "zlog" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "anyhow", "chrono", @@ -8581,7 +8641,7 @@ checksum = "bd8f3f50b848df28f887acb68e41201b5aea6bc8a8dacc00fb40635ff9a72fea" [[package]] name = "ztracing" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" dependencies = [ "tracing", "tracing-subscriber", @@ -8592,7 +8652,7 @@ dependencies = [ [[package]] name = "ztracing_macro" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#20284e4f218081a2c9f90ab78dbb7062e6203725" +source = "git+https://github.com/zed-industries/zed#acfc71a42304a19d1c0b5753d3513c0ec0fa1547" [[package]] name = "zune-core" diff --git a/crates/coop/src/actions.rs b/crates/coop/src/actions.rs index 16bc4c6..8a5798b 100644 --- a/crates/coop/src/actions.rs +++ b/crates/coop/src/actions.rs @@ -43,7 +43,7 @@ pub fn load_embedded_fonts(cx: &App) { let embedded_fonts = Mutex::new(Vec::new()); let executor = cx.background_executor(); - executor.block(executor.scoped(|scope| { + cx.foreground_executor().block_on(executor.scoped(|scope| { for font_path in &font_paths { if !font_path.ends_with(".ttf") { continue; diff --git a/crates/state/src/lib.rs b/crates/state/src/lib.rs index 2b1699e..201027c 100644 --- a/crates/state/src/lib.rs +++ b/crates/state/src/lib.rs @@ -88,9 +88,8 @@ impl NostrRegistry { }); // Construct the lmdb - let lmdb = cx.background_executor().block(async move { - let path = config_dir().join("nostr"); - NostrLmdb::open(path) + let lmdb = cx.foreground_executor().block_on(async move { + NostrLmdb::open(config_dir().join("nostr")) .await .expect("Failed to initialize database") }); diff --git a/crates/ui/src/input/blink_cursor.rs b/crates/ui/src/input/blink_cursor.rs index cbc755c..27cdc08 100644 --- a/crates/ui/src/input/blink_cursor.rs +++ b/crates/ui/src/input/blink_cursor.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use gpui::{px, Context, Pixels, Timer}; +use gpui::{px, Context, Pixels}; static INTERVAL: Duration = Duration::from_millis(500); static PAUSE_DELAY: Duration = Duration::from_millis(300); @@ -54,7 +54,8 @@ impl BlinkCursor { // Schedule the next blink let epoch = self.next_epoch(); cx.spawn(async move |this, cx| { - Timer::after(INTERVAL).await; + cx.background_executor().timer(INTERVAL).await; + if let Some(this) = this.upgrade() { this.update(cx, |this, cx| this.blink(epoch, cx)); } @@ -76,7 +77,7 @@ impl BlinkCursor { // delay 500ms to start the blinking let epoch = self.next_epoch(); cx.spawn(async move |this, cx| { - Timer::after(PAUSE_DELAY).await; + cx.background_executor().timer(PAUSE_DELAY).await; if let Some(this) = this.upgrade() { this.update(cx, |this, cx| {