From 167ec92811b6fed389eddf23e31f044c67c70c38 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Wed, 25 Sep 2024 08:58:10 -0700 Subject: [PATCH] chore(deps): bump windows-rs from 0.54 to 0.57 This is the highest we can go right now because this change which went into 0.58 absolutely fucks our shit up: https://github.com/microsoft/windows-rs/pull/3111 --- Cargo.lock | 175 +++++-------------- Cargo.toml | 9 +- komorebi/Cargo.toml | 1 + komorebi/src/border_manager/border.rs | 25 ++- komorebi/src/com/mod.rs | 2 +- komorebi/src/monitor_reconciliator/hidden.rs | 3 +- komorebi/src/stackbar_manager/stackbar.rs | 33 +++- komorebi/src/windows_api.rs | 11 +- komorebi/src/winevent_listener.rs | 3 +- komorebic/src/main.rs | 5 +- 10 files changed, 110 insertions(+), 157 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d5a0bf04f..d14dd4149 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -486,9 +486,9 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", @@ -943,9 +943,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -953,9 +953,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -966,9 +966,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -1734,9 +1734,9 @@ checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fdeflate" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" +checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" dependencies = [ "simd-adler32", ] @@ -2392,9 +2392,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -2405,7 +2405,6 @@ dependencies = [ "pin-project-lite", "socket2 0.5.7", "tokio", - "tower", "tower-service", "tracing", ] @@ -2710,9 +2709,10 @@ dependencies = [ "which", "widestring", "win32-display-data", - "windows 0.54.0", - "windows-implement 0.53.0", - "windows-interface 0.53.0", + "windows 0.57.0", + "windows-core 0.57.0", + "windows-implement 0.57.0", + "windows-interface 0.57.0", "winput", "winreg", ] @@ -2747,7 +2747,7 @@ dependencies = [ "tracing", "tracing-appender", "tracing-subscriber", - "windows 0.54.0", + "windows 0.57.0", "windows-icons", ] @@ -2769,7 +2769,7 @@ dependencies = [ "komorebi-client", "random_word", "serde_json_lenient", - "windows 0.54.0", + "windows 0.57.0", ] [[package]] @@ -2809,7 +2809,7 @@ dependencies = [ "uds_windows", "which", "win32-display-data", - "windows 0.54.0", + "windows 0.57.0", ] [[package]] @@ -2856,9 +2856,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libfuzzer-sys" @@ -2922,7 +2922,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.4", + "redox_syscall 0.5.5", ] [[package]] @@ -3856,7 +3856,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "petgraph", - "redox_syscall 0.5.4", + "redox_syscall 0.5.5", "smallvec", "thread-id", "windows-targets 0.52.6", @@ -3884,26 +3884,6 @@ dependencies = [ "indexmap 2.5.0", ] -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "pin-project-lite" version = "0.2.14" @@ -3929,9 +3909,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plist" @@ -4033,7 +4013,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.21", + "toml_edit 0.22.22", ] [[package]] @@ -4112,9 +4092,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.36.1" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc" +checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" dependencies = [ "memchr", ] @@ -4273,9 +4253,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "62871f2d65009c0256aed1b9cfeeb8ac272833c404e13d53d400cd0dad7a2ac0" dependencies = [ "bitflags 2.6.0", ] @@ -4582,9 +4562,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -5138,18 +5118,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -5318,7 +5298,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.21", + "toml_edit 0.22.22", ] [[package]] @@ -5343,38 +5323,17 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow 0.6.19", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - [[package]] name = "tower-service" version = "0.3.3" @@ -5875,7 +5834,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" dependencies = [ "proc-macro2", - "quick-xml 0.36.1", + "quick-xml 0.36.2", "quote", ] @@ -6060,11 +6019,11 @@ checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "win32-display-data" version = "0.1.0" -source = "git+https://github.com/LGUG2Z/win32-display-data?rev=32a45cebf132c3d651ee22c0c40033a6b7edc945#32a45cebf132c3d651ee22c0c40033a6b7edc945" +source = "git+https://github.com/LGUG2Z/win32-display-data?rev=790d56567bd15b4ba3d49ed1ac9701ede6fab4a3#790d56567bd15b4ba3d49ed1ac9701ede6fab4a3" dependencies = [ "itertools", "thiserror", - "windows 0.54.0", + "windows 0.57.0", ] [[package]] @@ -6119,18 +6078,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" -dependencies = [ - "windows-core 0.54.0", - "windows-implement 0.53.0", - "windows-interface 0.53.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.57.0" @@ -6160,16 +6107,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-core" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" -dependencies = [ - "windows-result 0.1.2", - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.57.0" @@ -6217,17 +6154,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "windows-implement" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942ac266be9249c84ca862f0a164a39533dc2f6f33dc98ec89c8da99b82ea0bd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "windows-implement" version = "0.57.0" @@ -6261,17 +6187,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "windows-interface" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da33557140a288fae4e1d5f8873aaf9eb6613a9cf82c3e070223ff177f598b60" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "windows-interface" version = "0.57.0" @@ -6607,9 +6522,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "c52ac009d615e79296318c1bcce2d422aaca15ad08515e344feeda07df67a587" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 22bcf21c6..6f65675aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,14 +33,15 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] } paste = "1" sysinfo = "0.31" uds_windows = "1" -win32-display-data = { git = "https://github.com/LGUG2Z/win32-display-data", rev = "32a45cebf132c3d651ee22c0c40033a6b7edc945" } -windows-implement = { version = "0.53" } -windows-interface = { version = "0.53" } +win32-display-data = { git = "https://github.com/LGUG2Z/win32-display-data", rev = "790d56567bd15b4ba3d49ed1ac9701ede6fab4a3" } +windows-implement = { version = "0.57" } +windows-interface = { version = "0.57" } +windows-core = { version = "0.57" } shadow-rs = "0.35" which = "6" [workspace.dependencies.windows] -version = "0.54" +version = "0.57" features = [ "implement", "Win32_System_Com", diff --git a/komorebi/Cargo.toml b/komorebi/Cargo.toml index 6aca5e26c..4f9e68d84 100644 --- a/komorebi/Cargo.toml +++ b/komorebi/Cargo.toml @@ -47,6 +47,7 @@ which = { workspace = true } widestring = "1" win32-display-data = { workspace = true } windows = { workspace = true } +windows-core = { workspace = true } windows-implement = { workspace = true } windows-interface = { workspace = true } winput = "0.2" diff --git a/komorebi/src/border_manager/border.rs b/komorebi/src/border_manager/border.rs index ba07c0bd4..faecbc8b7 100644 --- a/komorebi/src/border_manager/border.rs +++ b/komorebi/src/border_manager/border.rs @@ -103,7 +103,8 @@ impl Border { tracing::debug!("border window event processing thread shutdown"); break; }; - TranslateMessage(&msg); + // TODO: error handling + let _ = TranslateMessage(&msg); DispatchMessageW(&msg); } @@ -191,27 +192,35 @@ impl Border { match STYLE.load() { BorderStyle::System => { if *WINDOWS_11 { - RoundRect(hdc, 0, 0, rect.right, rect.bottom, 20, 20); + // TODO: error handling + let _ = + RoundRect(hdc, 0, 0, rect.right, rect.bottom, 20, 20); } else { - Rectangle(hdc, 0, 0, rect.right, rect.bottom); + // TODO: error handling + let _ = Rectangle(hdc, 0, 0, rect.right, rect.bottom); } } BorderStyle::Rounded => { - RoundRect(hdc, 0, 0, rect.right, rect.bottom, 20, 20); + // TODO: error handling + let _ = RoundRect(hdc, 0, 0, rect.right, rect.bottom, 20, 20); } BorderStyle::Square => { - Rectangle(hdc, 0, 0, rect.right, rect.bottom); + // TODO: error handling + let _ = Rectangle(hdc, 0, 0, rect.right, rect.bottom); } } - DeleteObject(hpen); - DeleteObject(hbrush); + // TODO: error handling + let _ = DeleteObject(hpen); + // TODO: error handling + let _ = DeleteObject(hbrush); } Err(error) => { tracing::error!("could not get border rect: {}", error.to_string()) } } - EndPaint(window, &ps); + // TODO: error handling + let _ = EndPaint(window, &ps); LRESULT(0) } WM_DESTROY => { diff --git a/komorebi/src/com/mod.rs b/komorebi/src/com/mod.rs index 2d9ec1540..3907e0580 100644 --- a/komorebi/src/com/mod.rs +++ b/komorebi/src/com/mod.rs @@ -10,13 +10,13 @@ use interfaces::IServiceProvider; use std::ffi::c_void; -use windows::core::Interface; use windows::Win32::Foundation::HWND; use windows::Win32::System::Com::CoCreateInstance; use windows::Win32::System::Com::CoInitializeEx; use windows::Win32::System::Com::CoUninitialize; use windows::Win32::System::Com::CLSCTX_ALL; use windows::Win32::System::Com::COINIT_APARTMENTTHREADED; +use windows_core::Interface; struct ComInit(); diff --git a/komorebi/src/monitor_reconciliator/hidden.rs b/komorebi/src/monitor_reconciliator/hidden.rs index efef34fc5..5a54e5f67 100644 --- a/komorebi/src/monitor_reconciliator/hidden.rs +++ b/komorebi/src/monitor_reconciliator/hidden.rs @@ -77,7 +77,8 @@ impl Hidden { tracing::debug!("hidden window event processing thread shutdown"); break; }; - TranslateMessage(&msg); + // TODO: error handling + let _ = TranslateMessage(&msg); DispatchMessageW(&msg); } diff --git a/komorebi/src/stackbar_manager/stackbar.rs b/komorebi/src/stackbar_manager/stackbar.rs index 46e147c8a..46e5d1c7f 100644 --- a/komorebi/src/stackbar_manager/stackbar.rs +++ b/komorebi/src/stackbar_manager/stackbar.rs @@ -134,7 +134,8 @@ impl Stackbar { tracing::debug!("stackbar window event processing thread shutdown"); break; }; - TranslateMessage(&msg); + // TODO: error handling + let _ = TranslateMessage(&msg); DispatchMessageW(&msg); std::thread::sleep(Duration::from_millis(10)) @@ -232,16 +233,29 @@ impl Stackbar { match STYLE.load() { BorderStyle::System => { if *WINDOWS_11 { - RoundRect(hdc, rect.left, rect.top, rect.right, rect.bottom, 20, 20); + // TODO: error handling + let _ = RoundRect( + hdc, + rect.left, + rect.top, + rect.right, + rect.bottom, + 20, + 20, + ); } else { - Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom); + // TODO: error handling + let _ = Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom); } } BorderStyle::Rounded => { - RoundRect(hdc, rect.left, rect.top, rect.right, rect.bottom, 20, 20); + // TODO: error handling + let _ = + RoundRect(hdc, rect.left, rect.top, rect.right, rect.bottom, 20, 20); } BorderStyle::Square => { - Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom); + // TODO: error handling + let _ = Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom); } } @@ -267,9 +281,12 @@ impl Stackbar { } ReleaseDC(self.hwnd(), hdc); - DeleteObject(hpen); - DeleteObject(hbrush); - DeleteObject(hfont); + // TODO: error handling + let _ = DeleteObject(hpen); + // TODO: error handling + let _ = DeleteObject(hbrush); + // TODO: error handling + let _ = DeleteObject(hfont); } Ok(()) diff --git a/komorebi/src/windows_api.rs b/komorebi/src/windows_api.rs index b724dcc2d..42cfb3f53 100644 --- a/komorebi/src/windows_api.rs +++ b/komorebi/src/windows_api.rs @@ -456,7 +456,10 @@ impl WindowsApi { pub fn show_window(hwnd: HWND, command: SHOW_WINDOW_CMD) { // BOOL is returned but does not signify whether or not the operation was succesful // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow - unsafe { ShowWindow(hwnd, command) }; + // TODO: error handling + unsafe { + let _ = ShowWindow(hwnd, command); + }; } pub fn minimize_window(hwnd: HWND) { @@ -597,7 +600,8 @@ impl WindowsApi { pub fn round_rect(hdc: HDC, rect: &Rect, border_radius: i32) { unsafe { - RoundRect( + // TODO: error handling + let _ = RoundRect( hdc, rect.left, rect.top, @@ -610,7 +614,8 @@ impl WindowsApi { } pub fn rectangle(hdc: HDC, rect: &Rect) { unsafe { - Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom); + // TODO: error handling + let _ = Rectangle(hdc, rect.left, rect.top, rect.right, rect.bottom); } } fn set_cursor_pos(x: i32, y: i32) -> Result<()> { diff --git a/komorebi/src/winevent_listener.rs b/komorebi/src/winevent_listener.rs index f4477517c..fa8410453 100644 --- a/komorebi/src/winevent_listener.rs +++ b/komorebi/src/winevent_listener.rs @@ -43,7 +43,8 @@ pub fn start() { tracing::debug!("windows event processing thread shutdown"); break; }; - TranslateMessage(&msg); + // TODO: error handling + let _ = TranslateMessage(&msg); DispatchMessageW(&msg); } diff --git a/komorebic/src/main.rs b/komorebic/src/main.rs index 0a9f5314d..32a8c3731 100644 --- a/komorebic/src/main.rs +++ b/komorebic/src/main.rs @@ -2589,7 +2589,10 @@ Stop-Process -Name:komorebi -ErrorAction SilentlyContinue fn show_window(hwnd: HWND, command: SHOW_WINDOW_CMD) { // BOOL is returned but does not signify whether or not the operation was succesful // https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow - unsafe { ShowWindow(hwnd, command) }; + // TODO: error handling + unsafe { + let _ = ShowWindow(hwnd, command); + }; } fn remove_transparency(hwnd: HWND) {