chore(deps): update windows-sys crate to 0.59

This commit is contained in:
amrbashir
2024-08-15 15:40:44 +03:00
parent 095fcb055a
commit 8b13a6159d
5 changed files with 16 additions and 18 deletions

5
.changes/send-sync.md Normal file
View File

@@ -0,0 +1,5 @@
---
"global-hotkey": "minor"
---
Removed `Sync` and `Send` implementation for `GlobalHotKeyManager`

View File

@@ -0,0 +1,5 @@
---
"global-hotkey": "patch"
---
Update `windows-sys` crate to `0.59`

View File

@@ -26,7 +26,7 @@ cocoa = "0.25"
objc = "0.2"
[target."cfg(target_os = \"windows\")".dependencies.windows-sys]
version = "0.52"
version = "0.59"
features = [
"Win32_UI_WindowsAndMessaging",
"Win32_Foundation",

View File

@@ -161,15 +161,3 @@ impl GlobalHotKeyManager {
Ok(())
}
}
#[cfg(test)]
mod tests {
fn assert_send<T: Send>() {}
fn assert_sync<T: Sync>() {}
#[test]
fn is_send_sync() {
assert_send::<super::GlobalHotKeyManager>();
assert_sync::<super::GlobalHotKeyManager>();
}
}

View File

@@ -10,7 +10,7 @@ use windows_sys::Win32::{
UI::{
Input::KeyboardAndMouse::*,
WindowsAndMessaging::{
CreateWindowExW, DefWindowProcW, DestroyWindow, RegisterClassW, CW_USEDEFAULT, HMENU,
CreateWindowExW, DefWindowProcW, DestroyWindow, RegisterClassW, CW_USEDEFAULT,
WM_HOTKEY, WNDCLASSW, WS_EX_LAYERED, WS_EX_NOACTIVATE, WS_EX_TOOLWINDOW,
WS_EX_TRANSPARENT, WS_OVERLAPPED,
},
@@ -20,7 +20,7 @@ use windows_sys::Win32::{
use crate::{hotkey::HotKey, GlobalHotKeyEvent};
pub struct GlobalHotKeyManager {
hwnd: isize,
hwnd: HWND,
}
impl Drop for GlobalHotKeyManager {
@@ -61,12 +61,12 @@ impl GlobalHotKeyManager {
0,
CW_USEDEFAULT,
0,
HWND::default(),
HMENU::default(),
std::ptr::null_mut(),
std::ptr::null_mut(),
hinstance,
std::ptr::null_mut(),
);
if hwnd == 0 {
if hwnd.is_null() {
return Err(crate::Error::OsError(std::io::Error::last_os_error()));
}