Update windows-rs (#27379)

Release Notes:

- N/A
This commit is contained in:
张小白 2025-03-25 00:29:18 +08:00 committed by GitHub
parent 350c1e41d2
commit 57ffd6d78d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 48 additions and 45 deletions

77
Cargo.lock generated
View file

@ -2734,7 +2734,7 @@ dependencies = [
"serde", "serde",
"tempfile", "tempfile",
"util", "util",
"windows 0.60.0", "windows 0.61.1",
] ]
[[package]] [[package]]
@ -2777,7 +2777,7 @@ dependencies = [
"tokio-socks", "tokio-socks",
"url", "url",
"util", "util",
"windows 0.60.0", "windows 0.61.1",
"worktree", "worktree",
] ]
@ -5248,7 +5248,7 @@ dependencies = [
"text", "text",
"time", "time",
"util", "util",
"windows 0.60.0", "windows 0.61.1",
] ]
[[package]] [[package]]
@ -5685,7 +5685,7 @@ dependencies = [
"ui", "ui",
"unindent", "unindent",
"util", "util",
"windows 0.60.0", "windows 0.61.1",
"workspace", "workspace",
"zed_actions", "zed_actions",
] ]
@ -5885,8 +5885,9 @@ dependencies = [
"wayland-cursor", "wayland-cursor",
"wayland-protocols", "wayland-protocols",
"wayland-protocols-plasma", "wayland-protocols-plasma",
"windows 0.60.0", "windows 0.61.1",
"windows-core 0.60.1", "windows-core 0.61.0",
"windows-numerics",
"x11-clipboard", "x11-clipboard",
"x11rb", "x11rb",
"xim", "xim",
@ -13918,7 +13919,7 @@ dependencies = [
"theme", "theme",
"thiserror 2.0.12", "thiserror 2.0.12",
"util", "util",
"windows 0.60.0", "windows 0.61.1",
] ]
[[package]] [[package]]
@ -14296,7 +14297,7 @@ dependencies = [
"tree-sitter-md", "tree-sitter-md",
"ui", "ui",
"util", "util",
"windows 0.60.0", "windows 0.61.1",
"workspace", "workspace",
"zed_actions", "zed_actions",
"zeta", "zeta",
@ -15018,7 +15019,7 @@ dependencies = [
"theme", "theme",
"ui_macros", "ui_macros",
"util", "util",
"windows 0.60.0", "windows 0.61.1",
] ]
[[package]] [[package]]
@ -16330,12 +16331,12 @@ dependencies = [
[[package]] [[package]]
name = "windows" name = "windows"
version = "0.60.0" version = "0.61.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529" checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419"
dependencies = [ dependencies = [
"windows-collections", "windows-collections",
"windows-core 0.60.1", "windows-core 0.61.0",
"windows-future", "windows-future",
"windows-link", "windows-link",
"windows-numerics", "windows-numerics",
@ -16343,11 +16344,11 @@ dependencies = [
[[package]] [[package]]
name = "windows-collections" name = "windows-collections"
version = "0.1.1" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec" checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
dependencies = [ dependencies = [
"windows-core 0.60.1", "windows-core 0.61.0",
] ]
[[package]] [[package]]
@ -16396,24 +16397,24 @@ dependencies = [
[[package]] [[package]]
name = "windows-core" name = "windows-core"
version = "0.60.1" version = "0.61.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247" checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980"
dependencies = [ dependencies = [
"windows-implement 0.59.0", "windows-implement 0.60.0",
"windows-interface 0.59.0", "windows-interface 0.59.1",
"windows-link", "windows-link",
"windows-result 0.3.1", "windows-result 0.3.2",
"windows-strings 0.3.1", "windows-strings 0.4.0",
] ]
[[package]] [[package]]
name = "windows-future" name = "windows-future"
version = "0.1.1" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0" checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32"
dependencies = [ dependencies = [
"windows-core 0.60.1", "windows-core 0.61.0",
"windows-link", "windows-link",
] ]
@ -16441,9 +16442,9 @@ dependencies = [
[[package]] [[package]]
name = "windows-implement" name = "windows-implement"
version = "0.59.0" version = "0.60.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -16474,9 +16475,9 @@ dependencies = [
[[package]] [[package]]
name = "windows-interface" name = "windows-interface"
version = "0.59.0" version = "0.59.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb26fd936d991781ea39e87c3a27285081e3c0da5ca0fcbc02d368cc6f52ff01" checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -16485,17 +16486,17 @@ dependencies = [
[[package]] [[package]]
name = "windows-link" name = "windows-link"
version = "0.1.0" version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
[[package]] [[package]]
name = "windows-numerics" name = "windows-numerics"
version = "0.1.1" version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "005dea54e2f6499f2cee279b8f703b3cf3b5734a2d8d21867c8f44003182eeed" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
dependencies = [ dependencies = [
"windows-core 0.60.1", "windows-core 0.61.0",
"windows-link", "windows-link",
] ]
@ -16530,9 +16531,9 @@ dependencies = [
[[package]] [[package]]
name = "windows-result" name = "windows-result"
version = "0.3.1" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252"
dependencies = [ dependencies = [
"windows-link", "windows-link",
] ]
@ -16549,9 +16550,9 @@ dependencies = [
[[package]] [[package]]
name = "windows-strings" name = "windows-strings"
version = "0.3.1" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97"
dependencies = [ dependencies = [
"windows-link", "windows-link",
] ]
@ -17475,7 +17476,7 @@ dependencies = [
"vim", "vim",
"vim_mode_setting", "vim_mode_setting",
"welcome", "welcome",
"windows 0.60.0", "windows 0.61.1",
"winresource", "winresource",
"workspace", "workspace",
"zed_actions", "zed_actions",

View file

@ -613,7 +613,7 @@ features = [
] ]
[workspace.dependencies.windows] [workspace.dependencies.windows]
version = "0.60" version = "0.61"
features = [ features = [
"Foundation_Collections", "Foundation_Collections",
"Foundation_Numerics", "Foundation_Numerics",

View file

@ -205,7 +205,8 @@ blade-macros.workspace = true
flume = "0.11" flume = "0.11"
rand.workspace = true rand.workspace = true
windows.workspace = true windows.workspace = true
windows-core = "0.60" windows-core = "0.61"
windows-numerics = "0.2"
[dev-dependencies] [dev-dependencies]
backtrace = "0.3" backtrace = "0.3"

View file

@ -22,6 +22,7 @@ use windows::{
UI::WindowsAndMessaging::*, UI::WindowsAndMessaging::*,
}, },
}; };
use windows_numerics::Vector2;
use crate::*; use crate::*;
@ -668,7 +669,7 @@ impl DirectWriteState {
}; };
let bounds = unsafe { let bounds = unsafe {
render_target.GetGlyphRunWorldBounds( render_target.GetGlyphRunWorldBounds(
D2D_POINT_2F { x: 0.0, y: 0.0 }, Vector2 { X: 0.0, Y: 0.0 },
&glyph_run, &glyph_run,
DWRITE_MEASURING_MODE_NATURAL, DWRITE_MEASURING_MODE_NATURAL,
)? )?
@ -802,9 +803,9 @@ impl DirectWriteState {
let subpixel_shift = params let subpixel_shift = params
.subpixel_variant .subpixel_variant
.map(|v| v as f32 / SUBPIXEL_VARIANTS as f32); .map(|v| v as f32 / SUBPIXEL_VARIANTS as f32);
let baseline_origin = D2D_POINT_2F { let baseline_origin = Vector2 {
x: subpixel_shift.x / params.scale_factor, X: subpixel_shift.x / params.scale_factor,
y: subpixel_shift.y / params.scale_factor, Y: subpixel_shift.y / params.scale_factor,
}; };
// This `cast()` action here should never fail since we are running on Win10+, and // This `cast()` action here should never fail since we are running on Win10+, and
@ -1477,7 +1478,7 @@ fn is_color_glyph(
}; };
unsafe { unsafe {
factory.TranslateColorGlyphRun( factory.TranslateColorGlyphRun(
D2D_POINT_2F::default(), Vector2::default(),
&glyph_run as _, &glyph_run as _,
None, None,
DWRITE_GLYPH_IMAGE_FORMATS_COLR DWRITE_GLYPH_IMAGE_FORMATS_COLR