Skip to content

Commit

Permalink
chore(deps): update raw-window-handle to 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Jul 24, 2022
1 parent f38bc23 commit aef927b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changes/raw-window-handle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"window-vibrancy": "minor"
---

Update `raw-window-handle` dependency to 0.5
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[package]
name = "window-vibrancy"
description = "Make your windows vibrant."
authors = [ "Tauri Programme within The Commons Conservancy" ]
authors = ["Tauri Programme within The Commons Conservancy"]
version = "0.1.3"
edition = "2021"
rust-version = "1.56"
license = "Apache-2.0 OR MIT"
readme = "README.md"
repository = "https://github.com/tauri-apps/tauri-plugin-vibrancy"
documentation = "https://docs.rs/tauri-plugin-vibrancy"
keywords = [ "vibrancy", "acrylic", "mica", "blur", "windowing" ]
categories = [ "gui" ]
keywords = ["vibrancy", "acrylic", "mica", "blur", "windowing"]
categories = ["gui"]

[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"
targets = [ "x86_64-apple-darwin", "x86_64-pc-windows-msvc" ]
targets = ["x86_64-apple-darwin", "x86_64-pc-windows-msvc"]

[dependencies]
raw-window-handle = "0.4"
raw-window-handle = "0.5"

[dev-dependencies]
tao = "0.12"
Expand All @@ -31,7 +31,7 @@ features = [
"Win32_System_SystemInformation",
"Win32_Graphics_Gdi",
"Win32_Graphics_Dwm",
"Win32_UI_WindowsAndMessaging"
"Win32_UI_WindowsAndMessaging",
]

[target."cfg(target_os = \"macos\")".dependencies]
Expand Down
7 changes: 3 additions & 4 deletions src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,15 @@ fn get_function_impl(library: &str, function: &str) -> Option<FARPROC> {

macro_rules! get_function {
($lib:expr, $func:ident) => {
get_function_impl(concat!($lib, '\0'), concat!(stringify!($func), '\0')).map(|f| unsafe {
std::mem::transmute::<::windows_sys::Win32::Foundation::FARPROC, $func>(f)
})
get_function_impl(concat!($lib, '\0'), concat!(stringify!($func), '\0'))
.map(|f| std::mem::transmute::<::windows_sys::Win32::Foundation::FARPROC, $func>(f))
};
}

/// Returns a tuple of (major, minor, buildnumber)
fn get_windows_ver() -> Option<(u32, u32, u32)> {
type RtlGetVersion = unsafe extern "system" fn(*mut OSVERSIONINFOW) -> i32;
let handle = get_function!("ntdll.dll", RtlGetVersion);
let handle = unsafe { get_function!("ntdll.dll", RtlGetVersion) };
if let Some(rtl_get_version) = handle {
unsafe {
let mut vi = OSVERSIONINFOW {
Expand Down

0 comments on commit aef927b

Please sign in to comment.