mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-24 09:38:32 +02:00
chore(deps): bump windows-rs from 0.33 to 0.34
This commit is contained in:
34
Cargo.lock
generated
34
Cargo.lock
generated
@@ -1430,15 +1430,15 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows"
|
name = "windows"
|
||||||
version = "0.33.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0128fa8e65e0616e45033d68dc0b7fbd521080b7844e5cad3a4a4d201c4b2bd2"
|
checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows_aarch64_msvc 0.33.0",
|
"windows_aarch64_msvc 0.34.0",
|
||||||
"windows_i686_gnu 0.33.0",
|
"windows_i686_gnu 0.34.0",
|
||||||
"windows_i686_msvc 0.33.0",
|
"windows_i686_msvc 0.34.0",
|
||||||
"windows_x86_64_gnu 0.33.0",
|
"windows_x86_64_gnu 0.34.0",
|
||||||
"windows_x86_64_msvc 0.33.0",
|
"windows_x86_64_msvc 0.34.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1481,9 +1481,9 @@ checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.33.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cd761fd3eb9ab8cc1ed81e56e567f02dd82c4c837e48ac3b2181b9ffc5060807"
|
checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
@@ -1499,9 +1499,9 @@ checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.33.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cab0cf703a96bab2dc0c02c0fa748491294bf9b7feb27e1f4f96340f208ada0e"
|
checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
@@ -1517,9 +1517,9 @@ checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.33.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8cfdbe89cc9ad7ce618ba34abc34bbb6c36d99e96cae2245b7943cd75ee773d0"
|
checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
@@ -1535,9 +1535,9 @@ checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.33.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4dd9b0c0e9ece7bb22e84d70d01b71c6d6248b81a3c60d11869451b4cb24784"
|
checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
@@ -1553,9 +1553,9 @@ checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.33.0"
|
version = "0.34.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ff1e4aa646495048ec7f3ffddc411e1d829c026a2ec62b39da15c1055e406eaa"
|
checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9"
|
||||||
|
|
||||||
[[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.33"
|
version = "0.34"
|
||||||
features = [
|
features = [
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -37,16 +37,16 @@ impl Arrangement for DefaultLayout {
|
|||||||
) -> Vec<Rect> {
|
) -> Vec<Rect> {
|
||||||
let len = usize::from(len);
|
let len = usize::from(len);
|
||||||
let mut dimensions = match self {
|
let mut dimensions = match self {
|
||||||
DefaultLayout::BSP => recursive_fibonacci(
|
Self::BSP => recursive_fibonacci(
|
||||||
0,
|
0,
|
||||||
len,
|
len,
|
||||||
area,
|
area,
|
||||||
layout_flip,
|
layout_flip,
|
||||||
calculate_resize_adjustments(resize_dimensions),
|
calculate_resize_adjustments(resize_dimensions),
|
||||||
),
|
),
|
||||||
DefaultLayout::Columns => columns(area, len),
|
Self::Columns => columns(area, len),
|
||||||
DefaultLayout::Rows => rows(area, len),
|
Self::Rows => rows(area, len),
|
||||||
DefaultLayout::VerticalStack => {
|
Self::VerticalStack => {
|
||||||
let mut layouts: Vec<Rect> = vec![];
|
let mut layouts: Vec<Rect> = vec![];
|
||||||
|
|
||||||
let primary_right = match len {
|
let primary_right = match len {
|
||||||
@@ -88,7 +88,7 @@ impl Arrangement for DefaultLayout {
|
|||||||
|
|
||||||
layouts
|
layouts
|
||||||
}
|
}
|
||||||
DefaultLayout::HorizontalStack => {
|
Self::HorizontalStack => {
|
||||||
let mut layouts: Vec<Rect> = vec![];
|
let mut layouts: Vec<Rect> = vec![];
|
||||||
|
|
||||||
let bottom = match len {
|
let bottom = match len {
|
||||||
@@ -130,7 +130,7 @@ impl Arrangement for DefaultLayout {
|
|||||||
|
|
||||||
layouts
|
layouts
|
||||||
}
|
}
|
||||||
DefaultLayout::UltrawideVerticalStack => {
|
Self::UltrawideVerticalStack => {
|
||||||
let mut layouts: Vec<Rect> = vec![];
|
let mut layouts: Vec<Rect> = vec![];
|
||||||
|
|
||||||
let primary_right = match len {
|
let primary_right = match len {
|
||||||
@@ -475,6 +475,7 @@ fn calculate_resize_adjustments(resize_dimensions: &[Option<Rect>]) -> Vec<Optio
|
|||||||
cleaned_resize_adjustments
|
cleaned_resize_adjustments
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::only_used_in_recursion)]
|
||||||
fn recursive_fibonacci(
|
fn recursive_fibonacci(
|
||||||
idx: usize,
|
idx: usize,
|
||||||
count: usize,
|
count: usize,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ pub enum DefaultLayout {
|
|||||||
|
|
||||||
impl DefaultLayout {
|
impl DefaultLayout {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[allow(clippy::cast_precision_loss)]
|
#[allow(clippy::cast_precision_loss, clippy::only_used_in_recursion)]
|
||||||
pub fn resize(
|
pub fn resize(
|
||||||
&self,
|
&self,
|
||||||
unaltered: &Rect,
|
unaltered: &Rect,
|
||||||
|
|||||||
@@ -72,34 +72,34 @@ impl Direction for DefaultLayout {
|
|||||||
) -> bool {
|
) -> bool {
|
||||||
match op_direction {
|
match op_direction {
|
||||||
OperationDirection::Up => match self {
|
OperationDirection::Up => match self {
|
||||||
DefaultLayout::BSP => count > 2 && idx != 0 && idx != 1,
|
Self::BSP => count > 2 && idx != 0 && idx != 1,
|
||||||
DefaultLayout::Columns => false,
|
Self::Columns => false,
|
||||||
DefaultLayout::Rows | DefaultLayout::HorizontalStack => idx != 0,
|
Self::Rows | Self::HorizontalStack => idx != 0,
|
||||||
DefaultLayout::VerticalStack => idx != 0 && idx != 1,
|
Self::VerticalStack => idx != 0 && idx != 1,
|
||||||
DefaultLayout::UltrawideVerticalStack => idx > 2,
|
Self::UltrawideVerticalStack => idx > 2,
|
||||||
},
|
},
|
||||||
OperationDirection::Down => match self {
|
OperationDirection::Down => match self {
|
||||||
DefaultLayout::BSP => count > 2 && idx != count - 1 && idx % 2 != 0,
|
Self::BSP => count > 2 && idx != count - 1 && idx % 2 != 0,
|
||||||
DefaultLayout::Columns => false,
|
Self::Columns => false,
|
||||||
DefaultLayout::Rows => idx != count - 1,
|
Self::Rows => idx != count - 1,
|
||||||
DefaultLayout::VerticalStack => idx != 0 && idx != count - 1,
|
Self::VerticalStack => idx != 0 && idx != count - 1,
|
||||||
DefaultLayout::HorizontalStack => idx == 0,
|
Self::HorizontalStack => idx == 0,
|
||||||
DefaultLayout::UltrawideVerticalStack => idx > 1 && idx != count - 1,
|
Self::UltrawideVerticalStack => idx > 1 && idx != count - 1,
|
||||||
},
|
},
|
||||||
OperationDirection::Left => match self {
|
OperationDirection::Left => match self {
|
||||||
DefaultLayout::BSP => count > 1 && idx != 0,
|
Self::BSP => count > 1 && idx != 0,
|
||||||
DefaultLayout::Columns | DefaultLayout::VerticalStack => idx != 0,
|
Self::Columns | Self::VerticalStack => idx != 0,
|
||||||
DefaultLayout::Rows => false,
|
Self::Rows => false,
|
||||||
DefaultLayout::HorizontalStack => idx != 0 && idx != 1,
|
Self::HorizontalStack => idx != 0 && idx != 1,
|
||||||
DefaultLayout::UltrawideVerticalStack => count > 1 && idx != 1,
|
Self::UltrawideVerticalStack => count > 1 && idx != 1,
|
||||||
},
|
},
|
||||||
OperationDirection::Right => match self {
|
OperationDirection::Right => match self {
|
||||||
DefaultLayout::BSP => count > 1 && idx % 2 == 0 && idx != count - 1,
|
Self::BSP => count > 1 && idx % 2 == 0 && idx != count - 1,
|
||||||
DefaultLayout::Columns => idx != count - 1,
|
Self::Columns => idx != count - 1,
|
||||||
DefaultLayout::Rows => false,
|
Self::Rows => false,
|
||||||
DefaultLayout::VerticalStack => idx == 0,
|
Self::VerticalStack => idx == 0,
|
||||||
DefaultLayout::HorizontalStack => idx != 0 && idx != count - 1,
|
Self::HorizontalStack => idx != 0 && idx != count - 1,
|
||||||
DefaultLayout::UltrawideVerticalStack => match count {
|
Self::UltrawideVerticalStack => match count {
|
||||||
0 | 1 => false,
|
0 | 1 => false,
|
||||||
2 => idx != 0,
|
2 => idx != 0,
|
||||||
_ => idx < 2,
|
_ => idx < 2,
|
||||||
@@ -110,45 +110,40 @@ impl Direction for DefaultLayout {
|
|||||||
|
|
||||||
fn up_index(&self, idx: usize) -> usize {
|
fn up_index(&self, idx: usize) -> usize {
|
||||||
match self {
|
match self {
|
||||||
DefaultLayout::BSP => {
|
Self::BSP => {
|
||||||
if idx % 2 == 0 {
|
if idx % 2 == 0 {
|
||||||
idx - 1
|
idx - 1
|
||||||
} else {
|
} else {
|
||||||
idx - 2
|
idx - 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DefaultLayout::Columns => unreachable!(),
|
Self::Columns => unreachable!(),
|
||||||
DefaultLayout::Rows
|
Self::Rows | Self::VerticalStack | Self::UltrawideVerticalStack => idx - 1,
|
||||||
| DefaultLayout::VerticalStack
|
Self::HorizontalStack => 0,
|
||||||
| DefaultLayout::UltrawideVerticalStack => idx - 1,
|
|
||||||
DefaultLayout::HorizontalStack => 0,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn down_index(&self, idx: usize) -> usize {
|
fn down_index(&self, idx: usize) -> usize {
|
||||||
match self {
|
match self {
|
||||||
DefaultLayout::BSP
|
Self::BSP | Self::Rows | Self::VerticalStack | Self::UltrawideVerticalStack => idx + 1,
|
||||||
| DefaultLayout::Rows
|
Self::Columns => unreachable!(),
|
||||||
| DefaultLayout::VerticalStack
|
Self::HorizontalStack => 1,
|
||||||
| DefaultLayout::UltrawideVerticalStack => idx + 1,
|
|
||||||
DefaultLayout::Columns => unreachable!(),
|
|
||||||
DefaultLayout::HorizontalStack => 1,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn left_index(&self, idx: usize) -> usize {
|
fn left_index(&self, idx: usize) -> usize {
|
||||||
match self {
|
match self {
|
||||||
DefaultLayout::BSP => {
|
Self::BSP => {
|
||||||
if idx % 2 == 0 {
|
if idx % 2 == 0 {
|
||||||
idx - 2
|
idx - 2
|
||||||
} else {
|
} else {
|
||||||
idx - 1
|
idx - 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DefaultLayout::Columns | DefaultLayout::HorizontalStack => idx - 1,
|
Self::Columns | Self::HorizontalStack => idx - 1,
|
||||||
DefaultLayout::Rows => unreachable!(),
|
Self::Rows => unreachable!(),
|
||||||
DefaultLayout::VerticalStack => 0,
|
Self::VerticalStack => 0,
|
||||||
DefaultLayout::UltrawideVerticalStack => match idx {
|
Self::UltrawideVerticalStack => match idx {
|
||||||
0 => 1,
|
0 => 1,
|
||||||
1 => unreachable!(),
|
1 => unreachable!(),
|
||||||
_ => 0,
|
_ => 0,
|
||||||
@@ -158,10 +153,10 @@ impl Direction for DefaultLayout {
|
|||||||
|
|
||||||
fn right_index(&self, idx: usize) -> usize {
|
fn right_index(&self, idx: usize) -> usize {
|
||||||
match self {
|
match self {
|
||||||
DefaultLayout::BSP | DefaultLayout::Columns | DefaultLayout::HorizontalStack => idx + 1,
|
Self::BSP | Self::Columns | Self::HorizontalStack => idx + 1,
|
||||||
DefaultLayout::Rows => unreachable!(),
|
Self::Rows => unreachable!(),
|
||||||
DefaultLayout::VerticalStack => 1,
|
Self::VerticalStack => 1,
|
||||||
DefaultLayout::UltrawideVerticalStack => match idx {
|
Self::UltrawideVerticalStack => match idx {
|
||||||
1 => 0,
|
1 => 0,
|
||||||
0 => 2,
|
0 => 2,
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#![warn(clippy::all, clippy::nursery, clippy::pedantic)]
|
#![warn(clippy::all, clippy::nursery, clippy::pedantic)]
|
||||||
#![allow(clippy::missing_errors_doc)]
|
#![allow(clippy::missing_errors_doc, clippy::use_self)]
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
@@ -171,8 +171,8 @@ impl Sizing {
|
|||||||
#[must_use]
|
#[must_use]
|
||||||
pub const fn adjust_by(&self, value: i32, adjustment: i32) -> i32 {
|
pub const fn adjust_by(&self, value: i32, adjustment: i32) -> i32 {
|
||||||
match self {
|
match self {
|
||||||
Sizing::Increase => value + adjustment,
|
Self::Increase => value + adjustment,
|
||||||
Sizing::Decrease => {
|
Self::Decrease => {
|
||||||
if value > 0 && value - adjustment >= 0 {
|
if value > 0 && value - adjustment >= 0 {
|
||||||
value - adjustment
|
value - adjustment
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ winreg = "0.10"
|
|||||||
schemars = "0.8"
|
schemars = "0.8"
|
||||||
|
|
||||||
[dependencies.windows]
|
[dependencies.windows]
|
||||||
version = "0.33"
|
version = "0.34"
|
||||||
features = [
|
features = [
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
"Win32_Graphics_Dwm",
|
"Win32_Graphics_Dwm",
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::convert::TryInto;
|
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
|
|
||||||
use color_eyre::eyre::anyhow;
|
use color_eyre::eyre::anyhow;
|
||||||
@@ -438,9 +437,7 @@ impl WindowsApi {
|
|||||||
|
|
||||||
pub fn window_text_w(hwnd: HWND) -> Result<String> {
|
pub fn window_text_w(hwnd: HWND) -> Result<String> {
|
||||||
let mut text: [u16; 512] = [0; 512];
|
let mut text: [u16; 512] = [0; 512];
|
||||||
match WindowsResult::from(unsafe {
|
match WindowsResult::from(unsafe { GetWindowTextW(hwnd, &mut text) }) {
|
||||||
GetWindowTextW(hwnd, PWSTR(text.as_mut_ptr()), text.len().try_into()?)
|
|
||||||
}) {
|
|
||||||
WindowsResult::Ok(len) => {
|
WindowsResult::Ok(len) => {
|
||||||
let length = usize::try_from(len)?;
|
let length = usize::try_from(len)?;
|
||||||
Ok(String::from_utf16(&text[..length])?)
|
Ok(String::from_utf16(&text[..length])?)
|
||||||
@@ -495,7 +492,7 @@ impl WindowsApi {
|
|||||||
let mut class: [u16; BUF_SIZE] = [0; BUF_SIZE];
|
let mut class: [u16; BUF_SIZE] = [0; BUF_SIZE];
|
||||||
|
|
||||||
let len = Result::from(WindowsResult::from(unsafe {
|
let len = Result::from(WindowsResult::from(unsafe {
|
||||||
RealGetWindowClassW(hwnd, PWSTR(class.as_mut_ptr()), u32::try_from(BUF_SIZE)?)
|
RealGetWindowClassW(hwnd, &mut class)
|
||||||
}))?;
|
}))?;
|
||||||
|
|
||||||
Ok(String::from_utf16(&class[0..len as usize])?)
|
Ok(String::from_utf16(&class[0..len as usize])?)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#![allow(clippy::use_self)]
|
||||||
|
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use strum::Display;
|
use strum::Display;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ serde_json = "1"
|
|||||||
uds_windows = "1"
|
uds_windows = "1"
|
||||||
|
|
||||||
[dependencies.windows]
|
[dependencies.windows]
|
||||||
version = "0.33"
|
version = "0.34"
|
||||||
features = [
|
features = [
|
||||||
"Win32_Foundation",
|
"Win32_Foundation",
|
||||||
"Win32_UI_WindowsAndMessaging"
|
"Win32_UI_WindowsAndMessaging"
|
||||||
|
|||||||
Reference in New Issue
Block a user