1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 19:27:22 +03:00

gui: update windows dep to 0.4

This commit is contained in:
Wez Furlong 2021-03-14 15:25:33 -07:00
parent 90e8e6e105
commit 5681cd9b64
3 changed files with 9 additions and 92 deletions

83
Cargo.lock generated
View File

@ -4499,7 +4499,7 @@ dependencies = [
"wezterm-toast-notification", "wezterm-toast-notification",
"winapi 0.3.9", "winapi 0.3.9",
"window", "window",
"windows 0.3.1", "windows",
] ]
[[package]] [[package]]
@ -4598,7 +4598,7 @@ dependencies = [
"objc", "objc",
"open", "open",
"serde", "serde",
"windows 0.4.0", "windows",
"xml-rs", "xml-rs",
"zbus", "zbus",
"zvariant", "zvariant",
@ -4704,18 +4704,6 @@ dependencies = [
"xkbcommon", "xkbcommon",
] ]
[[package]]
name = "windows"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "426842497696b65fbfc575691d94ef65befb248ed1a8c4361e293c724e7ebe61"
dependencies = [
"const-sha1",
"windows_gen 0.3.1",
"windows_macros 0.3.1",
"windows_winmd",
]
[[package]] [[package]]
name = "windows" name = "windows"
version = "0.4.0" version = "0.4.0"
@ -4723,22 +4711,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "015de964f21e0b20b9744ebc6f3a3e4dfdd1788f133a4aeec09c035748f88a21" checksum = "015de964f21e0b20b9744ebc6f3a3e4dfdd1788f133a4aeec09c035748f88a21"
dependencies = [ dependencies = [
"const-sha1", "const-sha1",
"windows_gen 0.4.0", "windows_gen",
"windows_macros 0.4.0", "windows_macros",
]
[[package]]
name = "windows_gen"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ac8f0f06b647f42ee5459a8e1ffe41795647582c5926ec3fa363a91aad7d77"
dependencies = [
"proc-macro2",
"quote",
"squote",
"syn",
"windows_gen_macros 0.3.1",
"windows_winmd",
] ]
[[package]] [[package]]
@ -4751,18 +4725,7 @@ dependencies = [
"quote", "quote",
"squote", "squote",
"syn", "syn",
"windows_gen_macros 0.4.0", "windows_gen_macros",
]
[[package]]
name = "windows_gen_macros"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23eac2169a20173b890c496f9e0e1149a92ef29fe4ba96026b72eec363b993f9"
dependencies = [
"proc-macro2",
"quote",
"syn",
] ]
[[package]] [[package]]
@ -4776,20 +4739,6 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "windows_macros"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9edc57c944eec106c7823b425ab0fd9f90163489e50a4df747f65fcf9030e1fb"
dependencies = [
"proc-macro2",
"quote",
"squote",
"syn",
"windows_gen 0.3.1",
"windows_winmd",
]
[[package]] [[package]]
name = "windows_macros" name = "windows_macros"
version = "0.4.0" version = "0.4.0"
@ -4800,27 +4749,7 @@ dependencies = [
"quote", "quote",
"squote", "squote",
"syn", "syn",
"windows_gen 0.4.0", "windows_gen",
]
[[package]]
name = "windows_winmd"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16d44527d04c9713312ed598f5d6ce3c453754dbfc03ddc376615be4415ffc88"
dependencies = [
"windows_winmd_macros",
]
[[package]]
name = "windows_winmd_macros"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2353f43f512938450614a176abf2b6cb31ac3b84fd71c88470fee571303e3f36"
dependencies = [
"proc-macro2",
"quote",
"syn",
] ]
[[package]] [[package]]

View File

@ -13,7 +13,7 @@ anyhow = "1.0"
[target.'cfg(windows)'.build-dependencies] [target.'cfg(windows)'.build-dependencies]
embed-resource = "1.3" embed-resource = "1.3"
cc = "1.0" cc = "1.0"
windows = "0.3" windows = "0.4"
[dependencies] [dependencies]
anyhow = "1.0" anyhow = "1.0"
@ -71,7 +71,7 @@ window = { path = "../window", features=["wayland"]}
[target."cfg(windows)".dependencies] [target."cfg(windows)".dependencies]
shared_library = "0.1" shared_library = "0.1"
windows = "0.3" windows = "0.4"
winapi = { version = "0.3", features = [ winapi = { version = "0.3", features = [
"winuser", "winuser",
"consoleapi", "consoleapi",

View File

@ -404,20 +404,8 @@ fn run() -> anyhow::Result<()> {
// attributed to our application. // attributed to our application.
#[cfg(windows)] #[cfg(windows)]
{ {
/// Convert a rust string to a windows wide string
fn wide_string(s: &str) -> Vec<u16> {
use std::os::windows::ffi::OsStrExt;
std::ffi::OsStr::new(s)
.encode_wide()
.chain(std::iter::once(0))
.collect()
}
unsafe { unsafe {
win_bindings::SetCurrentProcessExplicitAppUserModelID( win_bindings::SetCurrentProcessExplicitAppUserModelID("org.wezfurlong.wezterm").is_ok();
wide_string("org.wezfurlong.wezterm").as_ptr(),
)
.is_ok();
} }
} }