chore(deps): update windows-sys crate to 0.59 and global-hotkey to 0.6 (#1665)

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

* update global-hotkey as well

* change files
This commit is contained in:
Amr Bashir
2024-08-21 17:04:03 +03:00
committed by GitHub
parent f690777a91
commit 3c52f30ea4
8 changed files with 72 additions and 34 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ thiserror = { workspace = true }
semver = { version = "1", optional = true }
[target."cfg(target_os = \"windows\")".dependencies.windows-sys]
version = "0.52"
version = "0.59"
features = [
"Win32_System_Threading",
"Win32_System_DataExchange",
@@ -53,7 +53,7 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
unsafe {
let hwnd = FindWindowW(class_name.as_ptr(), window_name.as_ptr());
if hwnd != 0 {
if !hwnd.is_null() {
let data = format!(
"{}|{}\0",
std::env::current_dir()
@@ -74,7 +74,7 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
}
}
} else {
app.manage(MutexHandle(hmutex));
app.manage(MutexHandle(hmutex as _));
let hwnd = create_event_target_window::<R>(&class_name, &window_name);
unsafe {
@@ -85,7 +85,7 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
)
};
app.manage(TargetWindowHandle(hwnd));
app.manage(TargetWindowHandle(hwnd as _));
}
Ok(())
@@ -101,12 +101,12 @@ pub fn init<R: Runtime>(f: Box<SingleInstanceCallback<R>>) -> TauriPlugin<R> {
pub fn destroy<R: Runtime, M: Manager<R>>(manager: &M) {
if let Some(hmutex) = manager.try_state::<MutexHandle>() {
unsafe {
ReleaseMutex(hmutex.0);
CloseHandle(hmutex.0);
ReleaseMutex(hmutex.0 as _);
CloseHandle(hmutex.0 as _);
}
}
if let Some(hwnd) = manager.try_state::<TargetWindowHandle>() {
unsafe { DestroyWindow(hwnd.0) };
unsafe { DestroyWindow(hwnd.0 as _) };
}
}
@@ -150,12 +150,12 @@ fn create_event_target_window<R: Runtime>(class_name: &[u16], window_name: &[u16
cbClsExtra: 0,
cbWndExtra: 0,
hInstance: GetModuleHandleW(std::ptr::null()),
hIcon: 0,
hCursor: 0,
hbrBackground: 0,
hIcon: std::ptr::null_mut(),
hCursor: std::ptr::null_mut(),
hbrBackground: std::ptr::null_mut(),
lpszMenuName: std::ptr::null(),
lpszClassName: class_name.as_ptr(),
hIconSm: 0,
hIconSm: std::ptr::null_mut(),
};
RegisterClassExW(&class);
@@ -179,8 +179,8 @@ fn create_event_target_window<R: Runtime>(class_name: &[u16], window_name: &[u16
0,
0,
0,
0,
0,
std::ptr::null_mut(),
std::ptr::null_mut(),
GetModuleHandleW(std::ptr::null()),
std::ptr::null(),
);