From c3e6bdd8ff72909ef614df6e4642d49377a1d236 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:52:54 +0000 Subject: [PATCH 1/4] build(deps): bump windows from 0.56.0 to 0.58.0 Bumps [windows](https://github.com/microsoft/windows-rs) from 0.56.0 to 0.58.0. - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.56.0...0.58.0) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 33 ++++++++++++++++++++++----------- gdk4-win32/Cargo.toml | 2 +- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e871bbb2678f..f5a90d777672 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2226,11 +2226,11 @@ dependencies = [ [[package]] name = "windows" -version = "0.56.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-core 0.56.0", + "windows-core 0.58.0", "windows-targets 0.52.6", ] @@ -2245,21 +2245,22 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.56.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ "windows-implement", "windows-interface", "windows-result", + "windows-strings", "windows-targets 0.52.6", ] [[package]] name = "windows-implement" -version = "0.56.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", @@ -2268,9 +2269,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.56.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", @@ -2279,10 +2280,20 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.1.2" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ + "windows-result", "windows-targets 0.52.6", ] diff --git a/gdk4-win32/Cargo.toml b/gdk4-win32/Cargo.toml index 4078b9dd205a..6e2b47c59712 100644 --- a/gdk4-win32/Cargo.toml +++ b/gdk4-win32/Cargo.toml @@ -29,7 +29,7 @@ gio.workspace = true glib.workspace = true libc.workspace = true khronos-egl = {version = "6.0", optional = true} -windows = { version = "0.56", features = [ +windows = { version = "0.58", features = [ "Win32_Foundation", "Win32_UI_WindowsAndMessaging", ], optional = true } From fd284603c8b4b1e58278839387241aaf6c93eb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 27 Aug 2024 12:46:56 +0300 Subject: [PATCH 2/4] gdk4-win32: Add missing v4_8 feature --- gdk4-win32/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/gdk4-win32/Cargo.toml b/gdk4-win32/Cargo.toml index 6e2b47c59712..af5cb90485aa 100644 --- a/gdk4-win32/Cargo.toml +++ b/gdk4-win32/Cargo.toml @@ -19,6 +19,7 @@ version = "4" [features] v4_4 = ["gdk4-win32-sys/v4_4", "gdk/v4_4"] +v4_8 = ["v4_4", "gdk4-win32-sys/v4_8", "gdk/v4_8"] egl = ["khronos-egl"] win32 = ["windows"] From adbeebec2c09a8803d4d55596f746b626cf80126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 27 Aug 2024 14:40:30 +0300 Subject: [PATCH 3/4] gdk4-win32: Fix docs build on Linux --- gdk4-win32/src/lib.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gdk4-win32/src/lib.rs b/gdk4-win32/src/lib.rs index 10435b995303..4ef8ed5a91fa 100644 --- a/gdk4-win32/src/lib.rs +++ b/gdk4-win32/src/lib.rs @@ -29,23 +29,23 @@ pub use win32_display::Win32DisplayFilterHandle; mod win32_hcursor; mod win32_surface; -#[cfg(not(feature = "win32"))] +#[cfg(not(all(feature = "win32", windows)))] pub struct HANDLE(pub isize); -#[cfg(not(feature = "win32"))] +#[cfg(not(all(feature = "win32", windows)))] pub struct HCURSOR(pub isize); -#[cfg(not(feature = "win32"))] +#[cfg(not(all(feature = "win32", windows)))] pub struct HICON(pub isize); -#[cfg(not(feature = "win32"))] +#[cfg(not(all(feature = "win32", windows)))] pub struct HWND(pub isize); -#[cfg(not(feature = "win32"))] +#[cfg(not(all(feature = "win32", windows)))] #[repr(transparent)] pub struct WPARAM(pub usize); -#[cfg(not(feature = "win32"))] +#[cfg(not(all(feature = "win32", windows)))] #[repr(transparent)] pub struct LPARAM(pub isize); -#[cfg(not(feature = "win32"))] +#[cfg(not(all(feature = "win32", windows)))] #[repr(C)] pub struct POINT { pub x: i32, @@ -53,7 +53,7 @@ pub struct POINT { } #[allow(non_snake_case)] -#[cfg(not(feature = "win32"))] +#[cfg(not(all(feature = "win32", windows)))] #[repr(C)] pub struct MSG { pub hwnd: HWND, @@ -64,7 +64,7 @@ pub struct MSG { pub pt: POINT, } -#[cfg(feature = "win32")] +#[cfg(all(feature = "win32", windows))] pub use windows::Win32::Foundation::{HANDLE, HWND}; -#[cfg(feature = "win32")] +#[cfg(all(feature = "win32", windows))] pub use windows::Win32::UI::WindowsAndMessaging::{HCURSOR, HICON, MSG}; From 3ad93c6d6003aaf767e54f41536e5aa1d6d54f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 27 Aug 2024 12:49:44 +0300 Subject: [PATCH 4/4] gdk4-win32: Fix isize / *mut c_void mismatches --- gdk4-win32/src/lib.rs | 10 ++++++---- gdk4-win32/src/win32_hcursor.rs | 6 +++--- gdk4-win32/src/win32_surface.rs | 11 ++++++++--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/gdk4-win32/src/lib.rs b/gdk4-win32/src/lib.rs index 4ef8ed5a91fa..205938b07e23 100644 --- a/gdk4-win32/src/lib.rs +++ b/gdk4-win32/src/lib.rs @@ -4,6 +4,8 @@ #![allow(deprecated)] #![cfg_attr(docsrs, feature(doc_cfg))] +use std::ffi::c_void; + pub use gdk; pub use gdk4_win32_sys as ffi; pub use gio; @@ -30,13 +32,13 @@ mod win32_hcursor; mod win32_surface; #[cfg(not(all(feature = "win32", windows)))] -pub struct HANDLE(pub isize); +pub struct HANDLE(pub *mut c_void); #[cfg(not(all(feature = "win32", windows)))] -pub struct HCURSOR(pub isize); +pub struct HCURSOR(pub *mut c_void); #[cfg(not(all(feature = "win32", windows)))] -pub struct HICON(pub isize); +pub struct HICON(pub *mut c_void); #[cfg(not(all(feature = "win32", windows)))] -pub struct HWND(pub isize); +pub struct HWND(pub *mut c_void); #[cfg(not(all(feature = "win32", windows)))] #[repr(transparent)] diff --git a/gdk4-win32/src/win32_hcursor.rs b/gdk4-win32/src/win32_hcursor.rs index 8c2f39b8c014..a93cc2d2e12f 100644 --- a/gdk4-win32/src/win32_hcursor.rs +++ b/gdk4-win32/src/win32_hcursor.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use std::ptr::NonNull; +use std::{ffi::c_void, ptr::NonNull}; use glib::{translate::*, types::Pointee}; @@ -17,7 +17,7 @@ impl Win32HCursor { unsafe { from_glib_full(ffi::gdk_win32_hcursor_new( display.as_ref().to_glib_none().0, - handle.0, + handle.0 as isize, destroyable.into_glib(), )) } @@ -25,6 +25,6 @@ impl Win32HCursor { pub fn handle(&self) -> HCURSOR { let ptr: NonNull = ObjectExt::property(self, "handle"); - HCURSOR(ptr.as_ptr() as _) + HCURSOR(ptr.as_ptr() as *mut c_void) } } diff --git a/gdk4-win32/src/win32_surface.rs b/gdk4-win32/src/win32_surface.rs index 37491d365524..3e98c6a91743 100644 --- a/gdk4-win32/src/win32_surface.rs +++ b/gdk4-win32/src/win32_surface.rs @@ -1,5 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. +use std::ffi::c_void; + use glib::translate::*; use crate::{ffi, prelude::*, Win32Surface, HWND}; @@ -14,7 +16,7 @@ impl Win32Surface { unsafe { from_glib_none(ffi::gdk_win32_surface_lookup_for_display( display.as_ref().to_glib_none().0, - anid.0, + anid.0 as isize, )) } } @@ -22,7 +24,7 @@ impl Win32Surface { #[doc(alias = "gdk_win32_surface_get_handle")] #[doc(alias = "get_handle")] pub fn handle(&self) -> HWND { - HWND(unsafe { ffi::gdk_win32_surface_get_handle(self.to_glib_none().0) }) + HWND(unsafe { ffi::gdk_win32_surface_get_handle(self.to_glib_none().0) } as *mut c_void) } #[cfg_attr(feature = "v4_8", deprecated = "Since 4.8")] @@ -30,6 +32,9 @@ impl Win32Surface { #[doc(alias = "get_impl_hwnd")] pub fn impl_hwnd(surface: &impl IsA) -> HWND { assert_initialized_main_thread!(); - HWND(unsafe { ffi::gdk_win32_surface_get_impl_hwnd(surface.as_ref().to_glib_none().0) }) + HWND( + unsafe { ffi::gdk_win32_surface_get_impl_hwnd(surface.as_ref().to_glib_none().0) } + as *mut c_void, + ) } }