From 87bec4d47ba6e5470b7e92946e6dbe171c7e741b Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sat, 20 Jan 2024 20:27:36 +0100 Subject: [PATCH] gdk-wayland: Drop the xkb feature It fails to build because of https://github.com/meh/rust-xkb/issues/8 We might remove that feature or replace it somehow The commit could also be reverted once upstream gets a new fixed release but for now, this breaks the docs (using --all-features) & CI --- .github/workflows/CI.yml | 2 +- gdk4-wayland/Cargo.toml | 2 -- gdk4-wayland/Gir.toml | 2 +- gdk4-wayland/README.md | 1 - gdk4-wayland/src/lib.rs | 3 --- gdk4-wayland/src/wayland_device.rs | 23 +++-------------------- 6 files changed, 5 insertions(+), 28 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b8e856d0dc49..9fb48d2ce90f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -50,7 +50,7 @@ jobs: - { name: "gdk4", features: "v4_14,gl", test_sys: true } - { name: "gdk4-wayland", - features: "v4_12,wayland_crate,egl,xkb_crate", + features: "v4_12,wayland_crate,egl", test_sys: true, } - { name: "gdk4-x11", features: "v4_4,xlib,egl", test_sys: false } diff --git a/gdk4-wayland/Cargo.toml b/gdk4-wayland/Cargo.toml index 2ca090e31e58..c0f70905b110 100644 --- a/gdk4-wayland/Cargo.toml +++ b/gdk4-wayland/Cargo.toml @@ -18,7 +18,6 @@ v4_10 = ["ffi/v4_10", "v4_4", "gdk/v4_10"] v4_12 = ["ffi/v4_12", "v4_10", "gdk/v4_12"] wayland_crate = ["wayland-client", "wayland-backend"] egl = ["khronos-egl"] -xkb_crate = ["xkb"] [package.metadata.docs.rs] all-features = true @@ -34,7 +33,6 @@ libc = "0.2" wayland-client = {version = "0.31.0", optional = true} wayland-backend = {version = "0.3.0", optional = true, features = ["client_system"]} khronos-egl = {version = "6.0", optional = true} -xkb = {version = "0.3", optional = true} [dev-dependencies] gir-format-check = "^0.1" diff --git a/gdk4-wayland/Gir.toml b/gdk4-wayland/Gir.toml index 2262eaf77172..5dcbb4001aa7 100644 --- a/gdk4-wayland/Gir.toml +++ b/gdk4-wayland/Gir.toml @@ -72,7 +72,7 @@ status = "generate" manual = true [[object.function]] name = "get_xkb_keymap" - manual = true + ignore = true [[object]] name = "GdkWayland.WaylandDisplay" diff --git a/gdk4-wayland/README.md b/gdk4-wayland/README.md index 980f78f615eb..1a0eae07ffbf 100644 --- a/gdk4-wayland/README.md +++ b/gdk4-wayland/README.md @@ -48,7 +48,6 @@ gdk-wayland = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gdk4-w | `v4_4` | Enable the new APIs part of GTK 4.4 | | `wayland_crate` | Integration with the [wayland-client](https://crates.io/crates/wayland-client) crate | | `egl` | Integration with the [khronos-egl](https://crates.io/crates/khronos-egl) crate | -| `xkb_crate` | Integration with [xkb](https://crates.io/crates/xkb) crate | ### See Also diff --git a/gdk4-wayland/src/lib.rs b/gdk4-wayland/src/lib.rs index cb774e727ec0..16ff64673303 100644 --- a/gdk4-wayland/src/lib.rs +++ b/gdk4-wayland/src/lib.rs @@ -13,9 +13,6 @@ pub use khronos_egl; #[cfg(feature = "wayland_crate")] #[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))] pub use wayland_client; -#[cfg(all(feature = "v4_4", feature = "xkb_crate"))] -#[cfg_attr(docsrs, doc(cfg(all(feature = "v4_4", feature = "xkb_crate"))))] -pub use xkb; mod auto; diff --git a/gdk4-wayland/src/wayland_device.rs b/gdk4-wayland/src/wayland_device.rs index f4cb26034432..cdc0af73a3fe 100644 --- a/gdk4-wayland/src/wayland_device.rs +++ b/gdk4-wayland/src/wayland_device.rs @@ -1,9 +1,9 @@ // Take a look at the license at the top of the repository in the LICENSE file. -#[cfg(any(feature = "wayland_crate", feature = "xkb_crate"))] +#[cfg(feature = "wayland_crate")] #[cfg_attr( docsrs, - doc(cfg(any(feature = "wayland_crate", feature = "xkb_crate"))) + doc(cfg(feature = "wayland_crate")) )] use glib::translate::*; #[cfg(feature = "wayland_crate")] @@ -13,9 +13,7 @@ use wayland_client::{ protocol::{wl_keyboard::WlKeyboard, wl_pointer::WlPointer, wl_seat::WlSeat}, Proxy, }; -#[cfg(all(feature = "v4_4", feature = "xkb_crate"))] -#[cfg_attr(docsrs, doc(cfg(all(feature = "v4_4", feature = "xkb_crate"))))] -use xkb::Keymap; + #[cfg(feature = "wayland_crate")] #[cfg_attr(docsrs, doc(cfg(feature = "wayland_crate")))] @@ -80,19 +78,4 @@ impl WaylandDevice { } } } - - #[cfg(all(feature = "v4_4", feature = "xkb_crate"))] - #[cfg_attr(docsrs, doc(cfg(all(feature = "v4_4", feature = "xkb_crate"))))] - #[doc(alias = "gdk_wayland_device_get_xkb_keymap")] - #[doc(alias = "get_xkb_keymap")] - pub fn xkb_keymap(&self) -> Option { - unsafe { - let ptr = ffi::gdk_wayland_device_get_xkb_keymap(self.to_glib_none().0); - if ptr.is_null() { - None - } else { - Some(Keymap::from_ptr(ptr as _)) - } - } - } }