Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement window sharing with the hl toplevel export proto #1179

Merged
merged 5 commits into from
Dec 5, 2022

Conversation

vaxerski
Copy link
Member

@vaxerski vaxerski commented Dec 4, 2022

@vaxerski vaxerski requested a review from fufexan December 4, 2022 19:22
@fufexan
Copy link
Member

fufexan commented Dec 4, 2022

Will fix.

@fufexan
Copy link
Member

fufexan commented Dec 5, 2022

Anyone good at Meson? I'm not sure how to add the protocol to protocols/meson.build akin to how it's done in CMake.
@sp1ritCS sorry for pinging, would you happen to know?

@sp1ritCS
Copy link
Contributor

sp1ritCS commented Dec 5, 2022

Doesn't adding it as [meson.project_source_root(), 'subprojects/hyprland-protocols/protocols/hyprland-toplevel-export-v1.xml'] to the protocols array work?

@fufexan
Copy link
Member

fufexan commented Dec 5, 2022

Doesn't adding it as [meson.project_source_root(), 'subprojects/hyprland-protocols/protocols/hyprland-toplevel-export-v1.xml'] to the protocols array work?

@sp1ritCS nope, it errors with this

protocols/meson.build:29:1: ERROR: Sandbox violation: Tried to grab file hyprland-toplevel-export-v1.xml from a nested subproject.

@fufexan
Copy link
Member

fufexan commented Dec 5, 2022

@eli-schwartz sorry for the ping, but you helped us in the past. Do you know the proper way of doing this?

Maybe I should try to package hyprland-protocols and reference it wayland-protocols-style?

@sp1ritCS
Copy link
Contributor

sp1ritCS commented Dec 5, 2022

Well, the "proper" way to do this is to add a meson file to the hyprland-protocols repo that builds the objects for it's protocols, that can then be included in hyprland via <supproject>.get_variable('<array name of protocols>'). But I assume @vaxerski would prefer not to add a meson file to the hyprland protocols repo 🙃 .

You might get arround the "sandbox" by symlinking subprojects/hyprland-protocols to somewhere outside subprojects :)

@eli-schwartz
Copy link

I'm always happy to be pinged for Meson questions, no need to apologize. :)

There are two ways to do this, and both of them use the same underlying functionality.

  • package hyprland-protocols and install it, then acquire those files via pkg-config.
  • use hyprland-protocols as a Meson subproject, mark the protocols as installable, and
    • generate a pkg-config file with e.g. a protocolsdir variable pointing to the install location
    • create a declare_dependency() exposing the same variable name, but pointing to the in-source-tree location

You can then look up the dependency and dep.get_variable('protocolsdir') / 'hyprland-toplevel-export-v1.xml') will comply with the sandbox because it uses the dependency interface to find it. This will work even if hyprland-protocols is a subproject.

@fufexan
Copy link
Member

fufexan commented Dec 5, 2022

But I assume @vaxerski would prefer not to add a meson file to the hyprland protocols repo upside_down_face .

I think it's fine. He lets me add Nix stuff everywhere, so there's even more reason to add Meson stuff :D.

You might get arround the "sandbox" by symlinking subprojects/hyprland-protocols to somewhere outside subprojects :)

I've tried doing that and it doesn't really work. I think I'll try adding a meson.build like both you and @eli-schwartz suggested.

Thanks for the input!

@fufexan
Copy link
Member

fufexan commented Dec 5, 2022

@eli-schwartz @sp1ritCS mind taking a look at hyprwm/hyprland-protocols@0dcff94 ? Maybe I've overcomplicated it. I took it from wayland-protocols and adapted.

@vaxerski
Copy link
Member Author

vaxerski commented Dec 5, 2022

All checks green! Thanks to everyone for the help :)

@vaxerski vaxerski merged commit 66fb083 into main Dec 5, 2022
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.

None yet

4 participants