Skip to content

Move window identifiers and similar to a new ashpd-handles crate#321

Draft
A6GibKm wants to merge 13 commits intobilelmoussaoui:masterfrom
A6GibKm:ashpd-handles
Draft

Move window identifiers and similar to a new ashpd-handles crate#321
A6GibKm wants to merge 13 commits intobilelmoussaoui:masterfrom
A6GibKm:ashpd-handles

Conversation

@A6GibKm
Copy link
Collaborator

@A6GibKm A6GibKm commented Dec 25, 2025

TODO:

  • test all combinations of features of ashpd-handles. I think there is a preexisting issue where raw_handles+gtk4_wayland (or gtk4_x11) fails to build, but raw_handles,gtk4 works.
  • test the demo (cannot build right now cus Builder, and because my toolbox does not have new enough deps)
  • Write into the commit why this is done, mostly to simplify the feature matrix testing, allow using the main branch of gtk-rs-core in a follow up (so that users are not blocked from using gtk-rs' main branch), and most importantly decouple the releases of ashpd from gtk-rs, however since we still have the glib feature for enums and a gtk4 feature for a gdk::RGBA this is not a complete solution.

Depends on #320.

@A6GibKm A6GibKm changed the base branch from master to bilelmoussaoui/build-with-cargo December 25, 2025 23:54
@A6GibKm A6GibKm force-pushed the ashpd-handles branch 5 times, most recently from 3ee4713 to ec736e7 Compare December 26, 2025 12:27
@bilelmoussaoui bilelmoussaoui force-pushed the bilelmoussaoui/build-with-cargo branch 10 times, most recently from 995d560 to de8e40c Compare December 28, 2025 12:27
@bilelmoussaoui
Copy link
Owner

can you rebase?

@A6GibKm
Copy link
Collaborator Author

A6GibKm commented Dec 28, 2025

Would it be possible to run CI? Before the rebase this was compiling, but locally I am getting issues compiling zvariant with the gvariant feature.

@A6GibKm A6GibKm changed the base branch from bilelmoussaoui/build-with-cargo to master December 28, 2025 13:49
@A6GibKm A6GibKm force-pushed the ashpd-handles branch 4 times, most recently from 10d5f14 to 5534cd5 Compare December 28, 2025 14:12
@A6GibKm
Copy link
Collaborator Author

A6GibKm commented Jan 4, 2026

ci passes now. this is prob not ready, but good enough for a review.

Moves windows identifiers, tokens, and AppIDs to a separate crate. We
move AppIDs since they are required by activation tokens and otherwise
we would need a third-crate to avoid a dependency cycle.

Some interesting changes from their original versions:

 - We need a custom Error type to avoid dependency cycles
 - We use zvariant instead of zbus::zvariant

The reasons to do this split is that

 - This allows to decouple ashpd releases from gtk-rs-core. It would be
   possible to release a new version of ashpd-handles as soon as there is
   a gtk-rs-core release.

 - This would allow to depend on gtk-rs-core's main branch in a
   follow-up without that much hassle backporting. This allows ashpd users
   to test new bindings in gtk-rs's main branch. Do note however, that
   users of the gtk4 feature (to implement From<Color> to gdk::RGBA) and
   the glib feature (to implement GEnum on enums) will still run into the
   same issue.

 - Simplifies testing the feature matrix by moving most of them to a
   smaller crate.

 - Someone might make use of these abstraction without using ashpd.
This is a dependency of zbus anyways.

Otherwise compilation fails with:

```
error[E0004]: non-exhaustive patterns: `&zvariant_utils::signature::Signature::Maybe(_)` not covered
   --> /var/home/deathwish/.local/share/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/zvariant-5.8.0/src/de.rs:198:11
    |
198 |     match signature {
    |           ^^^^^^^^^ pattern `&zvariant_utils::signature::Signature::Maybe(_)` not covered
    |
note: `zvariant_utils::signature::Signature` defined here
   --> /var/home/deathwish/.local/share/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/zvariant_utils-3.2.1/src/signature/mod.rs:42:1
    |
 42 | pub enum Signature {
    | ^^^^^^^^^^^^^^^^^^
...
 99 |     Maybe(Child),
    |     ----- not covered
    = note: the matched value is of type `&zvariant_utils::signature::Signature`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
217 ~         Signature::Structure { .. } => de.deserialize_seq(visitor),
218 ~         &zvariant_utils::signature::Signature::Maybe(_) => todo!(),
    |
```

wip: Add zbus_macros to client instead

This also fixes the issue and does not add a dependency that was not
there from the start.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants