diff --git a/Cargo.lock b/Cargo.lock index 8266e84f2..3ca719bb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3584,12 +3584,6 @@ dependencies = [ "lock_api 0.4.4", ] -[[package]] -name = "squote" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fccf17fd09e2455ea796d2ad267b64fa2c5cbd8701b2a93b555d2aa73449f7d" - [[package]] name = "ssh2" version = "0.9.1" @@ -4481,7 +4475,7 @@ dependencies = [ "wezterm-toast-notification", "winapi 0.3.9", "window", - "windows 0.5.0", + "windows", ] [[package]] @@ -4600,7 +4594,7 @@ dependencies = [ "objc", "open", "serde", - "windows 0.4.0", + "windows", "xml-rs", "zbus", "zvariant", @@ -4708,98 +4702,32 @@ dependencies = [ [[package]] name = "windows" -version = "0.4.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015de964f21e0b20b9744ebc6f3a3e4dfdd1788f133a4aeec09c035748f88a21" +checksum = "361f3533a83ee1a28c9be59683f40043db02dbedf6479ce8795657386195c97f" dependencies = [ "const-sha1", - "windows_gen 0.4.0", - "windows_macros 0.4.0", -] - -[[package]] -name = "windows" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91294bf1e3791f04e442c6d57ea2c118e21ca5b0953f9465fdc8c33046f5b5c9" -dependencies = [ - "const-sha1", - "windows_gen 0.5.0", - "windows_macros 0.5.0", + "windows_gen", + "windows_macros", ] [[package]] name = "windows_gen" -version = "0.4.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70028758c92f5ed61ce12ab8e7482dce152418bac41dbefe794511b9fb673022" +checksum = "54154dbc515d58723f6b6053c12f1065da7389f733660581b2391bd1af480452" dependencies = [ - "proc-macro2", - "quote", - "squote", - "syn", - "windows_gen_macros 0.4.0", -] - -[[package]] -name = "windows_gen" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "334e75d3c85c56ebb36e44efabd8f0da3c0b379ad2af9691aca5a1ad1ff202e8" -dependencies = [ - "proc-macro2", - "quote", - "squote", - "syn", - "windows_gen_macros 0.5.0", -] - -[[package]] -name = "windows_gen_macros" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a4e4aa3c108fc3112bb797662b14958d088d3b989f2560d89335775c566c88d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows_gen_macros" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97c77daa4275ca227bd89ea62adaa430f1e7281c1d35419bafe9e5f9ca69052" -dependencies = [ - "proc-macro2", - "quote", "syn", ] [[package]] name = "windows_macros" -version = "0.4.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e5b872245607ec18bf35eaa7a6146831c07449c0b724afd7403d732c6da856" +checksum = "0f7794c652845dc466cb8dc1b86c08345707c8144bc53e9086430047c7d33b76" dependencies = [ - "proc-macro2", - "quote", - "squote", "syn", - "windows_gen 0.4.0", -] - -[[package]] -name = "windows_macros" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8411774b50e671ab93d4579f74d966059a32fc749295659b0946e09ae3869726" -dependencies = [ - "proc-macro2", - "quote", - "squote", - "syn", - "windows_gen 0.5.0", + "windows_gen", ] [[package]] diff --git a/wezterm-gui/Cargo.toml b/wezterm-gui/Cargo.toml index 27728ebef..f9b49bc0e 100644 --- a/wezterm-gui/Cargo.toml +++ b/wezterm-gui/Cargo.toml @@ -14,7 +14,7 @@ anyhow = "1.0" [target.'cfg(windows)'.build-dependencies] embed-resource = "1.3" cc = "1.0" -windows = "0.5" +windows = "0.9" [dependencies] anyhow = "1.0" @@ -73,7 +73,7 @@ window = { path = "../window", features=["wayland"]} [target."cfg(windows)".dependencies] shared_library = "0.1" -windows = "0.5" +windows = "0.9" winapi = { version = "0.3", features = [ "winuser", "consoleapi", diff --git a/wezterm-gui/build.rs b/wezterm-gui/build.rs index 24d150ad1..728b5949f 100644 --- a/wezterm-gui/build.rs +++ b/wezterm-gui/build.rs @@ -147,7 +147,7 @@ END } embed_resource::compile(rcfile_name); - windows::build!(windows::win32::shell::SetCurrentProcessExplicitAppUserModelID); + windows::build!(Windows::Win32::Shell::SetCurrentProcessExplicitAppUserModelID); } #[cfg(target_os = "macos")] diff --git a/wezterm-gui/src/main.rs b/wezterm-gui/src/main.rs index 43b717cee..1d09c2a7b 100644 --- a/wezterm-gui/src/main.rs +++ b/wezterm-gui/src/main.rs @@ -468,7 +468,7 @@ pub fn run_ls_fonts(config: config::ConfigHandle, _cmd: &LsFontsCommand) -> anyh #[cfg(windows)] mod win_bindings { ::windows::include_bindings!(); - pub use self::windows::win32::shell::SetCurrentProcessExplicitAppUserModelID; + pub use self::Windows::Win32::Shell::SetCurrentProcessExplicitAppUserModelID; } fn run() -> anyhow::Result<()> { diff --git a/wezterm-toast-notification/Cargo.toml b/wezterm-toast-notification/Cargo.toml index 1466f7da7..09e9a5d6f 100644 --- a/wezterm-toast-notification/Cargo.toml +++ b/wezterm-toast-notification/Cargo.toml @@ -22,8 +22,8 @@ core-foundation = "0.7" objc = "0.2" [target.'cfg(windows)'.dependencies] -windows = "0.4" +windows = "0.9" xml-rs = "0.8" [target.'cfg(windows)'.build-dependencies] -windows = "0.4" +windows = "0.9" diff --git a/wezterm-toast-notification/build.rs b/wezterm-toast-notification/build.rs index a93316813..403360f73 100644 --- a/wezterm-toast-notification/build.rs +++ b/wezterm-toast-notification/build.rs @@ -5,9 +5,10 @@ fn main() { #[cfg(windows)] { windows::build!( - windows::data::xml::dom::XmlDocument, - windows::foundation::*, - windows::ui::notifications::*, + Windows::Data::Xml::Dom::XmlDocument, + Windows::Foundation::*, + Windows::UI::Notifications::*, + Windows::Win32::SystemServices::E_POINTER, ); } } diff --git a/wezterm-toast-notification/src/windows.rs b/wezterm-toast-notification/src/windows.rs index 6c8a589a2..2b2ed4826 100644 --- a/wezterm-toast-notification/src/windows.rs +++ b/wezterm-toast-notification/src/windows.rs @@ -9,7 +9,7 @@ mod bindings { } use bindings::{ - windows::data::xml::dom::XmlDocument, windows::foundation::*, windows::ui::notifications::*, + Windows::Data::Xml::Dom::XmlDocument, Windows::Foundation::*, Windows::UI::Notifications::*, }; use windows::{Error as WinError, Interface, Object}; @@ -17,7 +17,7 @@ fn unwrap_arg(a: &Option) -> Result<&T, WinError> { match a { Some(t) => Ok(t), None => Err(WinError::new( - ::windows::ErrorCode::E_POINTER, + crate::windows::bindings::Windows::Win32::SystemServices::E_POINTER, "option is none", )), } @@ -36,7 +36,7 @@ fn show_notif_impl(toast: TN) -> Result<(), Box> { "" }; - xml.load_xml(format!( + xml.LoadXml(format!( r#" @@ -51,14 +51,14 @@ fn show_notif_impl(toast: TN) -> Result<(), Box> { url_actions ))?; - let notif = ToastNotification::create_toast_notification(xml)?; + let notif = ToastNotification::CreateToastNotification(xml)?; - notif.activated(TypedEventHandler::new( + notif.Activated(TypedEventHandler::new( move |_: &Option, result: &Option| { // let myself = unwrap_arg(myself)?; let result = unwrap_arg(result)?.cast::()?; - let args = result.arguments()?; + let args = result.Arguments()?; if args == "show" { if let Some(url) = toast.url.as_ref() { @@ -82,10 +82,9 @@ fn show_notif_impl(toast: TN) -> Result<(), Box> { }))?; */ - let notifier = - ToastNotificationManager::create_toast_notifier_with_id("org.wezfurlong.wezterm")?; + let notifier = ToastNotificationManager::CreateToastNotifierWithId("org.wezfurlong.wezterm")?; - notifier.show(¬if)?; + notifier.Show(¬if)?; Ok(()) }