mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-23 00:58:37 +02:00
chore(deps): bump windows from 0.39.0 to 0.40.0
Bumps [windows](https://github.com/microsoft/windows-rs) from 0.39.0 to 0.40.0. - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.39.0...0.40.0) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
48
Cargo.lock
generated
48
Cargo.lock
generated
@@ -1501,15 +1501,17 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows"
|
name = "windows"
|
||||||
version = "0.39.0"
|
version = "0.40.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a"
|
checksum = "e30acc718a52fb130fec72b1cb5f55ffeeec9253e1b785e94db222178a6acaa1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows_aarch64_msvc 0.39.0",
|
"windows_aarch64_gnullvm",
|
||||||
"windows_i686_gnu 0.39.0",
|
"windows_aarch64_msvc 0.40.0",
|
||||||
"windows_i686_msvc 0.39.0",
|
"windows_i686_gnu 0.40.0",
|
||||||
"windows_x86_64_gnu 0.39.0",
|
"windows_i686_msvc 0.40.0",
|
||||||
"windows_x86_64_msvc 0.39.0",
|
"windows_x86_64_gnu 0.40.0",
|
||||||
|
"windows_x86_64_gnullvm",
|
||||||
|
"windows_x86_64_msvc 0.40.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1538,6 +1540,12 @@ dependencies = [
|
|||||||
"windows_x86_64_msvc 0.36.1",
|
"windows_x86_64_msvc 0.36.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_gnullvm"
|
||||||
|
version = "0.40.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f3caa4a1a16561b714323ca6b0817403738583033a6a92e04c5d10d4ba37ca10"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.28.0"
|
version = "0.28.0"
|
||||||
@@ -1552,9 +1560,9 @@ checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.39.0"
|
version = "0.40.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2"
|
checksum = "328973c62dfcc50fb1aaa8e7100676e0b642fe56bac6bafff3327902db843ab4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
@@ -1570,9 +1578,9 @@ checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.39.0"
|
version = "0.40.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b"
|
checksum = "aa5b09fad70f0df85dea2ac2a525537e415e2bf63ee31cf9b8e263645ee9f3c1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
@@ -1588,9 +1596,9 @@ checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.39.0"
|
version = "0.40.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106"
|
checksum = "2a1ad4031c1a98491fa195d8d43d7489cb749f135f2e5c4eed58da094bd0d876"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
@@ -1606,9 +1614,15 @@ checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.39.0"
|
version = "0.40.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65"
|
checksum = "520ff37edd72da8064b49d2281182898e17f0688ae9f4070bca27e4b5c162ac7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnullvm"
|
||||||
|
version = "0.40.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "046e5b82215102c44fd75f488f1b9158973d02aa34d06ed85c23d6f5520a2853"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
@@ -1624,9 +1638,9 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.39.0"
|
version = "0.40.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809"
|
checksum = "2a0c9c6df55dd1bfa76e131cef44bdd8ec9c819ef3611f04dfe453fd5bfeda28"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winput"
|
name = "winput"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ strum = { version = "0.24", features = ["derive"] }
|
|||||||
schemars = "0.8"
|
schemars = "0.8"
|
||||||
|
|
||||||
[dependencies.windows]
|
[dependencies.windows]
|
||||||
version = "0.39"
|
version = "0.40"
|
||||||
features = [
|
features = [
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ winput = "0.2"
|
|||||||
winreg = "0.10"
|
winreg = "0.10"
|
||||||
|
|
||||||
[dependencies.windows]
|
[dependencies.windows]
|
||||||
version = "0.39"
|
version = "0.40"
|
||||||
features = [
|
features = [
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
"Win32_Graphics_Dwm",
|
"Win32_Graphics_Dwm",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
|
use std::slice;
|
||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
|
|
||||||
use color_eyre::eyre::anyhow;
|
use color_eyre::eyre::anyhow;
|
||||||
@@ -10,19 +11,17 @@ use windows::core::Result as WindowsCrateResult;
|
|||||||
use windows::core::PCSTR;
|
use windows::core::PCSTR;
|
||||||
use windows::core::PWSTR;
|
use windows::core::PWSTR;
|
||||||
use windows::Win32::Foundation::BOOL;
|
use windows::Win32::Foundation::BOOL;
|
||||||
|
use windows::Win32::Foundation::COLORREF;
|
||||||
use windows::Win32::Foundation::HANDLE;
|
use windows::Win32::Foundation::HANDLE;
|
||||||
use windows::Win32::Foundation::HINSTANCE;
|
use windows::Win32::Foundation::HINSTANCE;
|
||||||
use windows::Win32::Foundation::HWND;
|
use windows::Win32::Foundation::HWND;
|
||||||
use windows::Win32::Foundation::LPARAM;
|
use windows::Win32::Foundation::LPARAM;
|
||||||
use windows::Win32::Foundation::POINT;
|
use windows::Win32::Foundation::POINT;
|
||||||
use windows::Win32::Foundation::RECT;
|
|
||||||
use windows::Win32::Graphics::Dwm::DwmGetWindowAttribute;
|
use windows::Win32::Graphics::Dwm::DwmGetWindowAttribute;
|
||||||
use windows::Win32::Graphics::Dwm::DwmSetWindowAttribute;
|
use windows::Win32::Graphics::Dwm::DwmSetWindowAttribute;
|
||||||
use windows::Win32::Graphics::Dwm::DWMWA_CLOAKED;
|
use windows::Win32::Graphics::Dwm::DWMWA_CLOAKED;
|
||||||
use windows::Win32::Graphics::Dwm::DWMWA_EXTENDED_FRAME_BOUNDS;
|
|
||||||
use windows::Win32::Graphics::Dwm::DWMWA_WINDOW_CORNER_PREFERENCE;
|
use windows::Win32::Graphics::Dwm::DWMWA_WINDOW_CORNER_PREFERENCE;
|
||||||
use windows::Win32::Graphics::Dwm::DWMWCP_ROUND;
|
use windows::Win32::Graphics::Dwm::DWMWCP_ROUND;
|
||||||
use windows::Win32::Graphics::Dwm::DWMWINDOWATTRIBUTE;
|
|
||||||
use windows::Win32::Graphics::Dwm::DWM_CLOAKED_APP;
|
use windows::Win32::Graphics::Dwm::DWM_CLOAKED_APP;
|
||||||
use windows::Win32::Graphics::Dwm::DWM_CLOAKED_INHERITED;
|
use windows::Win32::Graphics::Dwm::DWM_CLOAKED_INHERITED;
|
||||||
use windows::Win32::Graphics::Dwm::DWM_CLOAKED_SHELL;
|
use windows::Win32::Graphics::Dwm::DWM_CLOAKED_SHELL;
|
||||||
@@ -193,16 +192,9 @@ impl WindowsApi {
|
|||||||
callback: MONITORENUMPROC,
|
callback: MONITORENUMPROC,
|
||||||
callback_data_address: isize,
|
callback_data_address: isize,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
unsafe {
|
unsafe { EnumDisplayMonitors(HDC(0), None, callback, LPARAM(callback_data_address)) }
|
||||||
EnumDisplayMonitors(
|
.ok()
|
||||||
HDC(0),
|
.process()
|
||||||
std::ptr::null_mut(),
|
|
||||||
callback,
|
|
||||||
LPARAM(callback_data_address),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
.ok()
|
|
||||||
.process()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn valid_hmonitors() -> Result<Vec<isize>> {
|
pub fn valid_hmonitors() -> Result<Vec<isize>> {
|
||||||
@@ -433,7 +425,7 @@ impl WindowsApi {
|
|||||||
|
|
||||||
// Behaviour is undefined if an invalid HWND is given
|
// Behaviour is undefined if an invalid HWND is given
|
||||||
// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid
|
// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid
|
||||||
let thread_id = unsafe { GetWindowThreadProcessId(hwnd, &mut process_id) };
|
let thread_id = unsafe { GetWindowThreadProcessId(hwnd, Option::from(&mut process_id)) };
|
||||||
|
|
||||||
(process_id, thread_id)
|
(process_id, thread_id)
|
||||||
}
|
}
|
||||||
@@ -534,12 +526,7 @@ impl WindowsApi {
|
|||||||
let text_ptr = path.as_mut_ptr();
|
let text_ptr = path.as_mut_ptr();
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
QueryFullProcessImageNameW(
|
QueryFullProcessImageNameW(handle, PROCESS_NAME_WIN32, PWSTR(text_ptr), &mut len)
|
||||||
handle,
|
|
||||||
PROCESS_NAME_WIN32,
|
|
||||||
PWSTR(text_ptr),
|
|
||||||
std::ptr::addr_of_mut!(len),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
.ok()
|
.ok()
|
||||||
.process()?;
|
.process()?;
|
||||||
@@ -566,37 +553,15 @@ impl WindowsApi {
|
|||||||
Ok(String::from_utf16(&class[0..len as usize])?)
|
Ok(String::from_utf16(&class[0..len as usize])?)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn dwm_get_window_attribute<T>(
|
pub fn is_window_cloaked(hwnd: HWND) -> Result<bool> {
|
||||||
hwnd: HWND,
|
let mut cloaked = 0_u32.to_be_bytes();
|
||||||
attribute: DWMWINDOWATTRIBUTE,
|
|
||||||
value: &mut T,
|
|
||||||
) -> Result<()> {
|
|
||||||
unsafe {
|
unsafe {
|
||||||
DwmGetWindowAttribute(
|
DwmGetWindowAttribute(hwnd, DWMWA_CLOAKED, &mut cloaked)?;
|
||||||
hwnd,
|
|
||||||
attribute,
|
|
||||||
(value as *mut T).cast(),
|
|
||||||
u32::try_from(std::mem::size_of::<T>())?,
|
|
||||||
)?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn window_rect_with_extended_frame_bounds(hwnd: HWND) -> Result<Rect> {
|
|
||||||
let mut rect = RECT::default();
|
|
||||||
Self::dwm_get_window_attribute(hwnd, DWMWA_EXTENDED_FRAME_BOUNDS, &mut rect)?;
|
|
||||||
|
|
||||||
Ok(Rect::from(rect))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn is_window_cloaked(hwnd: HWND) -> Result<bool> {
|
|
||||||
let mut cloaked: u32 = 0;
|
|
||||||
Self::dwm_get_window_attribute(hwnd, DWMWA_CLOAKED, &mut cloaked)?;
|
|
||||||
|
|
||||||
Ok(matches!(
|
Ok(matches!(
|
||||||
cloaked,
|
u32::from_be_bytes(cloaked),
|
||||||
DWM_CLOAKED_APP | DWM_CLOAKED_SHELL | DWM_CLOAKED_INHERITED
|
DWM_CLOAKED_APP | DWM_CLOAKED_SHELL | DWM_CLOAKED_INHERITED
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
@@ -617,7 +582,7 @@ impl WindowsApi {
|
|||||||
let mut monitor_info: MONITORINFO = unsafe { std::mem::zeroed() };
|
let mut monitor_info: MONITORINFO = unsafe { std::mem::zeroed() };
|
||||||
monitor_info.cbSize = u32::try_from(std::mem::size_of::<MONITORINFO>())?;
|
monitor_info.cbSize = u32::try_from(std::mem::size_of::<MONITORINFO>())?;
|
||||||
|
|
||||||
unsafe { GetMonitorInfoW(hmonitor, std::ptr::addr_of_mut!(monitor_info).cast()) }
|
unsafe { GetMonitorInfoW(hmonitor, &mut monitor_info) }
|
||||||
.ok()
|
.ok()
|
||||||
.process()?;
|
.process()?;
|
||||||
|
|
||||||
@@ -691,7 +656,7 @@ impl WindowsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn create_solid_brush(colour: u32) -> HBRUSH {
|
pub fn create_solid_brush(colour: u32) -> HBRUSH {
|
||||||
unsafe { CreateSolidBrush(colour) }
|
unsafe { CreateSolidBrush(COLORREF(colour)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn register_class_a(window_class: &WNDCLASSA) -> Result<u16> {
|
pub fn register_class_a(window_class: &WNDCLASSA) -> Result<u16> {
|
||||||
@@ -716,8 +681,7 @@ impl WindowsApi {
|
|||||||
DwmSetWindowAttribute(
|
DwmSetWindowAttribute(
|
||||||
HWND(hwnd),
|
HWND(hwnd),
|
||||||
DWMWA_WINDOW_CORNER_PREFERENCE,
|
DWMWA_WINDOW_CORNER_PREFERENCE,
|
||||||
std::ptr::addr_of!(round).cast(),
|
slice::from_raw_parts(std::ptr::addr_of!(round).cast(), 4),
|
||||||
4,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.process()
|
.process()
|
||||||
@@ -740,7 +704,7 @@ impl WindowsApi {
|
|||||||
std::ptr::null(),
|
std::ptr::null(),
|
||||||
);
|
);
|
||||||
|
|
||||||
SetLayeredWindowAttributes(hwnd, TRANSPARENCY_COLOUR, 0, LWA_COLORKEY);
|
SetLayeredWindowAttributes(hwnd, COLORREF(TRANSPARENCY_COLOUR), 0, LWA_COLORKEY);
|
||||||
|
|
||||||
hwnd
|
hwnd
|
||||||
}
|
}
|
||||||
@@ -748,14 +712,8 @@ impl WindowsApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn invalidate_border_rect() -> Result<()> {
|
pub fn invalidate_border_rect() -> Result<()> {
|
||||||
unsafe {
|
unsafe { InvalidateRect(HWND(BORDER_HWND.load(Ordering::SeqCst)), None, false) }
|
||||||
InvalidateRect(
|
.ok()
|
||||||
HWND(BORDER_HWND.load(Ordering::SeqCst)),
|
.process()
|
||||||
std::ptr::null(),
|
|
||||||
false,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
.ok()
|
|
||||||
.process()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ use std::collections::VecDeque;
|
|||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
|
|
||||||
use windows::Win32::Foundation::BOOL;
|
use windows::Win32::Foundation::BOOL;
|
||||||
|
use windows::Win32::Foundation::COLORREF;
|
||||||
use windows::Win32::Foundation::HWND;
|
use windows::Win32::Foundation::HWND;
|
||||||
use windows::Win32::Foundation::LPARAM;
|
use windows::Win32::Foundation::LPARAM;
|
||||||
use windows::Win32::Foundation::LRESULT;
|
use windows::Win32::Foundation::LRESULT;
|
||||||
@@ -133,15 +134,19 @@ pub extern "system" fn border_window(
|
|||||||
WM_PAINT => {
|
WM_PAINT => {
|
||||||
let border_rect = *BORDER_RECT.lock();
|
let border_rect = *BORDER_RECT.lock();
|
||||||
let mut ps = PAINTSTRUCT::default();
|
let mut ps = PAINTSTRUCT::default();
|
||||||
let hdc = BeginPaint(window, std::ptr::addr_of_mut!(ps).cast());
|
let hdc = BeginPaint(window, &mut ps);
|
||||||
let hpen = CreatePen(PS_SOLID, 20, BORDER_COLOUR_CURRENT.load(Ordering::SeqCst));
|
let hpen = CreatePen(
|
||||||
|
PS_SOLID,
|
||||||
|
20,
|
||||||
|
COLORREF(BORDER_COLOUR_CURRENT.load(Ordering::SeqCst)),
|
||||||
|
);
|
||||||
let hbrush = WindowsApi::create_solid_brush(TRANSPARENCY_COLOUR);
|
let hbrush = WindowsApi::create_solid_brush(TRANSPARENCY_COLOUR);
|
||||||
|
|
||||||
SelectObject(hdc, hpen);
|
SelectObject(hdc, hpen);
|
||||||
SelectObject(hdc, hbrush);
|
SelectObject(hdc, hbrush);
|
||||||
Rectangle(hdc, 0, 0, border_rect.right, border_rect.bottom);
|
Rectangle(hdc, 0, 0, border_rect.right, border_rect.bottom);
|
||||||
EndPaint(window, &ps);
|
EndPaint(window, &ps);
|
||||||
ValidateRect(window, std::ptr::null());
|
ValidateRect(window, None);
|
||||||
|
|
||||||
LRESULT(0)
|
LRESULT(0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ sysinfo = "0.26"
|
|||||||
uds_windows = "1"
|
uds_windows = "1"
|
||||||
|
|
||||||
[dependencies.windows]
|
[dependencies.windows]
|
||||||
version = "0.39"
|
version = "0.40"
|
||||||
features = [
|
features = [
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
"Win32_UI_WindowsAndMessaging"
|
"Win32_UI_WindowsAndMessaging"
|
||||||
|
|||||||
Reference in New Issue
Block a user