From 4a3f7ee34eb680aa539b342c6c78c12e240da350 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Thu, 3 Feb 2022 12:57:35 -0800 Subject: [PATCH] chore(deps): bump windows-rs from 0.30 to 0.32 --- Cargo.lock | 46 ++++++------ komorebi-core/Cargo.toml | 2 +- komorebi/Cargo.toml | 2 +- komorebi/src/set_window_position.rs | 30 ++++---- komorebi/src/styles.rs | 108 ++++++++++++++-------------- komorebi/src/windows_api.rs | 11 ++- komorebic/Cargo.toml | 2 +- 7 files changed, 104 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a80bc32..15c3e230 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,9 +84,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.0.13" +version = "3.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08799f92c961c7a1cf0cc398a9073da99e21ce388b46372c37f3191f2f3eed3e" +checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62" dependencies = [ "atty", "bitflags", @@ -102,9 +102,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.0.12" +version = "3.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fd2078197a22f338bd4fbf7d6387eb6f0d6a3c69e6cbc09f5c93e97321fd92a" +checksum = "9a1132dc3944b31c20dd8b906b3a9f0a5d0243e092d59171414969657ac6aa85" dependencies = [ "heck 0.4.0", "proc-macro-error", @@ -531,9 +531,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.116" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74" +checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" [[package]] name = "linked-hash-map" @@ -1448,15 +1448,15 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b749ebd2304aa012c5992d11a25d07b406bdbe5f79d371cb7a918ce501a19eb0" +checksum = "fbedf6db9096bc2364adce0ae0aa636dcd89f3c3f2cd67947062aaf0ca2a10ec" dependencies = [ - "windows_aarch64_msvc 0.30.0", - "windows_i686_gnu 0.30.0", - "windows_i686_msvc 0.30.0", - "windows_x86_64_gnu 0.30.0", - "windows_x86_64_msvc 0.30.0", + "windows_aarch64_msvc 0.32.0", + "windows_i686_gnu 0.32.0", + "windows_i686_msvc 0.32.0", + "windows_x86_64_gnu 0.32.0", + "windows_x86_64_msvc 0.32.0", ] [[package]] @@ -1499,9 +1499,9 @@ checksum = "c3d027175d00b01e0cbeb97d6ab6ebe03b12330a35786cbaca5252b1c4bf5d9b" [[package]] name = "windows_aarch64_msvc" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29277a4435d642f775f63c7d1faeb927adba532886ce0287bd985bffb16b6bca" +checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" [[package]] name = "windows_i686_gnu" @@ -1517,9 +1517,9 @@ checksum = "8793f59f7b8e8b01eda1a652b2697d87b93097198ae85f823b969ca5b89bba58" [[package]] name = "windows_i686_gnu" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145e1989da93956c68d1864f32fb97c8f561a8f89a5125f6a2b7ea75524e4b8" +checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" [[package]] name = "windows_i686_msvc" @@ -1535,9 +1535,9 @@ checksum = "8602f6c418b67024be2996c512f5f995de3ba417f4c75af68401ab8756796ae4" [[package]] name = "windows_i686_msvc" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a09e3a0d4753b73019db171c1339cd4362c8c44baf1bcea336235e955954a6" +checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" [[package]] name = "windows_x86_64_gnu" @@ -1553,9 +1553,9 @@ checksum = "f3d615f419543e0bd7d2b3323af0d86ff19cbc4f816e6453f36a2c2ce889c354" [[package]] name = "windows_x86_64_gnu" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca64fcb0220d58db4c119e050e7af03c69e6f4f415ef69ec1773d9aab422d5a" +checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" [[package]] name = "windows_x86_64_msvc" @@ -1571,9 +1571,9 @@ checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561" [[package]] name = "windows_x86_64_msvc" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08cabc9f0066848fef4bc6a1c1668e6efce38b661d2aeec75d18d8617eebb5f1" +checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" [[package]] name = "winput" diff --git a/komorebi-core/Cargo.toml b/komorebi-core/Cargo.toml index 3ccf33cb..e665ab52 100644 --- a/komorebi-core/Cargo.toml +++ b/komorebi-core/Cargo.toml @@ -15,7 +15,7 @@ strum = { version = "0.23", features = ["derive"] } schemars = "0.8" [dependencies.windows] -version = "0.30" +version = "0.32" features = [ "Win32_Foundation", ] diff --git a/komorebi/Cargo.toml b/komorebi/Cargo.toml index 78cbd310..8e8ed261 100644 --- a/komorebi/Cargo.toml +++ b/komorebi/Cargo.toml @@ -41,7 +41,7 @@ winreg = "0.10" schemars = "0.8" [dependencies.windows] -version = "0.30" +version = "0.32" features = [ "Win32_Foundation", "Win32_Graphics_Dwm", diff --git a/komorebi/src/set_window_position.rs b/komorebi/src/set_window_position.rs index d05ccdd7..95a1c4a2 100644 --- a/komorebi/src/set_window_position.rs +++ b/komorebi/src/set_window_position.rs @@ -18,20 +18,20 @@ use windows::Win32::UI::WindowsAndMessaging::SWP_SHOWWINDOW; bitflags! { #[derive(Default)] pub struct SetWindowPosition: u32 { - const ASYNC_WINDOW_POS = SWP_ASYNCWINDOWPOS; - const DEFER_ERASE = SWP_DEFERERASE; - const DRAW_FRAME = SWP_DRAWFRAME; - const FRAME_CHANGED = SWP_FRAMECHANGED; - const HIDE_WINDOW = SWP_HIDEWINDOW; - const NO_ACTIVATE = SWP_NOACTIVATE; - const NO_COPY_BITS = SWP_NOCOPYBITS; - const NO_MOVE = SWP_NOMOVE; - const NO_OWNER_Z_ORDER = SWP_NOOWNERZORDER; - const NO_REDRAW = SWP_NOREDRAW; - const NO_REPOSITION = SWP_NOREPOSITION; - const NO_SEND_CHANGING = SWP_NOSENDCHANGING; - const NO_SIZE = SWP_NOSIZE; - const NO_Z_ORDER = SWP_NOZORDER; - const SHOW_WINDOW = SWP_SHOWWINDOW; + const ASYNC_WINDOW_POS = SWP_ASYNCWINDOWPOS.0; + const DEFER_ERASE = SWP_DEFERERASE.0; + const DRAW_FRAME = SWP_DRAWFRAME.0; + const FRAME_CHANGED = SWP_FRAMECHANGED.0; + const HIDE_WINDOW = SWP_HIDEWINDOW.0; + const NO_ACTIVATE = SWP_NOACTIVATE.0; + const NO_COPY_BITS = SWP_NOCOPYBITS.0; + const NO_MOVE = SWP_NOMOVE.0; + const NO_OWNER_Z_ORDER = SWP_NOOWNERZORDER.0; + const NO_REDRAW = SWP_NOREDRAW.0; + const NO_REPOSITION = SWP_NOREPOSITION.0; + const NO_SEND_CHANGING = SWP_NOSENDCHANGING.0; + const NO_SIZE = SWP_NOSIZE.0; + const NO_Z_ORDER = SWP_NOZORDER.0; + const SHOW_WINDOW = SWP_SHOWWINDOW.0; } } diff --git a/komorebi/src/styles.rs b/komorebi/src/styles.rs index 7064575c..54f35f83 100644 --- a/komorebi/src/styles.rs +++ b/komorebi/src/styles.rs @@ -58,33 +58,33 @@ use windows::Win32::UI::WindowsAndMessaging::WS_VSCROLL; bitflags! { #[derive(Default)] pub struct WindowStyle: u32 { - const BORDER = WS_BORDER; - const CAPTION = WS_CAPTION; - const CHILD = WS_CHILD; - const CHILDWINDOW = WS_CHILDWINDOW; - const CLIPCHILDREN = WS_CLIPCHILDREN; - const CLIPSIBLINGS = WS_CLIPSIBLINGS; - const DISABLED = WS_DISABLED; - const DLGFRAME = WS_DLGFRAME; - const GROUP = WS_GROUP; - const HSCROLL = WS_HSCROLL; - const ICONIC = WS_ICONIC; - const MAXIMIZE = WS_MAXIMIZE; - const MAXIMIZEBOX = WS_MAXIMIZEBOX; - const MINIMIZE = WS_MINIMIZE; - const MINIMIZEBOX = WS_MINIMIZEBOX; - const OVERLAPPED = WS_OVERLAPPED; - const OVERLAPPEDWINDOW = WS_OVERLAPPEDWINDOW; - const POPUP = WS_POPUP; - const POPUPWINDOW = WS_POPUPWINDOW; - const SIZEBOX = WS_SIZEBOX; - const SYSMENU = WS_SYSMENU; - const TABSTOP = WS_TABSTOP; - const THICKFRAME = WS_THICKFRAME; - const TILED = WS_TILED; - const TILEDWINDOW = WS_TILEDWINDOW; - const VISIBLE = WS_VISIBLE; - const VSCROLL = WS_VSCROLL; + const BORDER = WS_BORDER.0; + const CAPTION = WS_CAPTION.0; + const CHILD = WS_CHILD.0; + const CHILDWINDOW = WS_CHILDWINDOW.0; + const CLIPCHILDREN = WS_CLIPCHILDREN.0; + const CLIPSIBLINGS = WS_CLIPSIBLINGS.0; + const DISABLED = WS_DISABLED.0; + const DLGFRAME = WS_DLGFRAME.0; + const GROUP = WS_GROUP.0; + const HSCROLL = WS_HSCROLL.0; + const ICONIC = WS_ICONIC.0; + const MAXIMIZE = WS_MAXIMIZE.0; + const MAXIMIZEBOX = WS_MAXIMIZEBOX.0; + const MINIMIZE = WS_MINIMIZE.0; + const MINIMIZEBOX = WS_MINIMIZEBOX.0; + const OVERLAPPED = WS_OVERLAPPED.0; + const OVERLAPPEDWINDOW = WS_OVERLAPPEDWINDOW.0; + const POPUP = WS_POPUP.0; + const POPUPWINDOW = WS_POPUPWINDOW.0; + const SIZEBOX = WS_SIZEBOX.0; + const SYSMENU = WS_SYSMENU.0; + const TABSTOP = WS_TABSTOP.0; + const THICKFRAME = WS_THICKFRAME.0; + const TILED = WS_TILED.0; + const TILEDWINDOW = WS_TILEDWINDOW.0; + const VISIBLE = WS_VISIBLE.0; + const VSCROLL = WS_VSCROLL.0; } } @@ -92,32 +92,32 @@ bitflags! { bitflags! { #[derive(Default)] pub struct ExtendedWindowStyle: u32 { - const ACCEPTFILES = WS_EX_ACCEPTFILES; - const APPWINDOW = WS_EX_APPWINDOW; - const CLIENTEDGE = WS_EX_CLIENTEDGE; - const COMPOSITED = WS_EX_COMPOSITED; - const CONTEXTHELP = WS_EX_CONTEXTHELP; - const CONTROLPARENT = WS_EX_CONTROLPARENT; - const DLGMODALFRAME = WS_EX_DLGMODALFRAME; - const LAYERED = WS_EX_LAYERED; - const LAYOUTRTL = WS_EX_LAYOUTRTL; - const LEFT = WS_EX_LEFT; - const LEFTSCROLLBAR = WS_EX_LEFTSCROLLBAR; - const LTRREADING = WS_EX_LTRREADING; - const MDICHILD = WS_EX_MDICHILD; - const NOACTIVATE = WS_EX_NOACTIVATE; - const NOINHERITLAYOUT = WS_EX_NOINHERITLAYOUT; - const NOPARENTNOTIFY = WS_EX_NOPARENTNOTIFY; - const NOREDIRECTIONBITMAP = WS_EX_NOREDIRECTIONBITMAP; - const OVERLAPPEDWINDOW = WS_EX_OVERLAPPEDWINDOW; - const PALETTEWINDOW = WS_EX_PALETTEWINDOW; - const RIGHT = WS_EX_RIGHT; - const RIGHTSCROLLBAR = WS_EX_RIGHTSCROLLBAR; - const RTLREADING = WS_EX_RTLREADING; - const STATICEDGE = WS_EX_STATICEDGE; - const TOOLWINDOW = WS_EX_TOOLWINDOW; - const TOPMOST = WS_EX_TOPMOST; - const TRANSPARENT = WS_EX_TRANSPARENT; - const WINDOWEDGE = WS_EX_WINDOWEDGE; + const ACCEPTFILES = WS_EX_ACCEPTFILES.0; + const APPWINDOW = WS_EX_APPWINDOW.0; + const CLIENTEDGE = WS_EX_CLIENTEDGE.0; + const COMPOSITED = WS_EX_COMPOSITED.0; + const CONTEXTHELP = WS_EX_CONTEXTHELP.0; + const CONTROLPARENT = WS_EX_CONTROLPARENT.0; + const DLGMODALFRAME = WS_EX_DLGMODALFRAME.0; + const LAYERED = WS_EX_LAYERED.0; + const LAYOUTRTL = WS_EX_LAYOUTRTL.0; + const LEFT = WS_EX_LEFT.0; + const LEFTSCROLLBAR = WS_EX_LEFTSCROLLBAR.0; + const LTRREADING = WS_EX_LTRREADING.0; + const MDICHILD = WS_EX_MDICHILD.0; + const NOACTIVATE = WS_EX_NOACTIVATE.0; + const NOINHERITLAYOUT = WS_EX_NOINHERITLAYOUT.0; + const NOPARENTNOTIFY = WS_EX_NOPARENTNOTIFY.0; + const NOREDIRECTIONBITMAP = WS_EX_NOREDIRECTIONBITMAP.0; + const OVERLAPPEDWINDOW = WS_EX_OVERLAPPEDWINDOW.0; + const PALETTEWINDOW = WS_EX_PALETTEWINDOW.0; + const RIGHT = WS_EX_RIGHT.0; + const RIGHTSCROLLBAR = WS_EX_RIGHTSCROLLBAR.0; + const RTLREADING = WS_EX_RTLREADING.0; + const STATICEDGE = WS_EX_STATICEDGE.0; + const TOOLWINDOW = WS_EX_TOOLWINDOW.0; + const TOPMOST = WS_EX_TOPMOST.0; + const TRANSPARENT = WS_EX_TRANSPARENT.0; + const WINDOWEDGE = WS_EX_WINDOWEDGE.0; } } diff --git a/komorebi/src/windows_api.rs b/komorebi/src/windows_api.rs index 759b15e8..161323a8 100644 --- a/komorebi/src/windows_api.rs +++ b/komorebi/src/windows_api.rs @@ -37,6 +37,7 @@ use windows::Win32::System::Threading::GetCurrentThreadId; use windows::Win32::System::Threading::OpenProcess; use windows::Win32::System::Threading::QueryFullProcessImageNameW; use windows::Win32::System::Threading::PROCESS_ACCESS_RIGHTS; +use windows::Win32::System::Threading::PROCESS_NAME_WIN32; use windows::Win32::System::Threading::PROCESS_QUERY_INFORMATION; use windows::Win32::UI::Input::KeyboardAndMouse::SetFocus; use windows::Win32::UI::WindowsAndMessaging::AllowSetForegroundWindow; @@ -66,6 +67,7 @@ use windows::Win32::UI::WindowsAndMessaging::GWL_STYLE; use windows::Win32::UI::WindowsAndMessaging::GW_HWNDNEXT; use windows::Win32::UI::WindowsAndMessaging::HWND_NOTOPMOST; use windows::Win32::UI::WindowsAndMessaging::HWND_TOPMOST; +use windows::Win32::UI::WindowsAndMessaging::SET_WINDOW_POS_FLAGS; use windows::Win32::UI::WindowsAndMessaging::SHOW_WINDOW_CMD; use windows::Win32::UI::WindowsAndMessaging::SPIF_SENDCHANGE; use windows::Win32::UI::WindowsAndMessaging::SPI_GETACTIVEWINDOWTRACKING; @@ -265,7 +267,7 @@ impl WindowsApi { layout.top, layout.right, layout.bottom, - flags, + SET_WINDOW_POS_FLAGS(flags), ) } .ok() @@ -467,7 +469,12 @@ impl WindowsApi { let text_ptr = path.as_mut_ptr(); unsafe { - QueryFullProcessImageNameW(handle, 0, PWSTR(text_ptr), std::ptr::addr_of_mut!(len)) + QueryFullProcessImageNameW( + handle, + PROCESS_NAME_WIN32, + PWSTR(text_ptr), + std::ptr::addr_of_mut!(len), + ) } .ok() .process()?; diff --git a/komorebic/Cargo.toml b/komorebic/Cargo.toml index 73d957de..8791c55c 100644 --- a/komorebic/Cargo.toml +++ b/komorebic/Cargo.toml @@ -27,7 +27,7 @@ serde_json = "1" uds_windows = "1" [dependencies.windows] -version = "0.30" +version = "0.32" features = [ "Win32_Foundation", "Win32_UI_WindowsAndMessaging"