refactor(exec-lib): vendor hyprland toplevel mapping protocol - #518
refactor(exec-lib): vendor hyprland toplevel mapping protocol#518sim590 wants to merge 1 commit into
Conversation
Replace the wayland-protocols-hyprland crate with the vendored hyprland-toplevel-mapping-v1.xml from hyprwm/hyprland-protocols at commit bd153e76f751f150a09328dbdeb5e4fab9d23622, the exact revision embedded in wayland-protocols-hyprland 1.2.0. Bindings are generated at compile time with wayland-scanner. This drops the unmaintained third-party crate and its LGPL-3.0 dependency while keeping the exact same protocol revision. wayland-protocols-wlr becomes a direct dependency since the protocol references zwlr_foreign_toplevel_handle_v1.
|
@H3rmt: disclamer: I was not familiar at all with this procedure and I just decided to let Deepseek do it. I tested and it still compiled and worked as it should. I took a look at the result and I pretty much don't see anywhere it could go wrong. The import instructions are replaced for our own local module and still does what it should so it seems alright. Feel free to ask for any changes, of course. |
| pkgs, | ||
| }: | ||
| rec { | ||
| # Vendored wayland protocol XML files must be kept in the cargo source |
There was a problem hiding this comment.
I don't think this is needed as src being ../. Also includes all files
| cargoArtifacts = craneLib.buildDepsOnly ( | ||
| commonArgs | ||
| // { | ||
| src = craneLib.cleanCargoSource ../.; |
There was a problem hiding this comment.
Although, this part was not easily testable for me as the nix file setup seems to be broken. I get errors in the pipeline about it and my local build doesn't work either. Deepseek was trying to fix it, but I stopped it since it's not related to this PR.
There was a problem hiding this comment.
I will check it myself when I am back from holiday
As discussed in #488, this vendors the hyprland-toplevel-mapping-v1.xml protocol spec directly from hyprwm/hyprland-protocols (commit bd153e76f751f150a09328dbdeb5e4fab9d23622, the exact revision embedded in wayland-protocols-hyprland 1.2.0) and drops the wayland-protocols-hyprland crate.
Bindings are generated at compile time with wayland-scanner, using the same module layout as the former crate, so the diff in wayland_capture.rs is limited to the import paths.
Notes:
Regarding avoiding hyprland-specific protocols entirely: the toplevel mapping is what ties Wayland toplevels to Hyprland window addresses, which hyprshell identifies clients by. I don't see a standard protocol providing that mapping, so this one stays.