Skip to content

Hyprland toplevel mapping protocol #9775

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

WhySoBad
Copy link
Contributor

@WhySoBad WhySoBad commented Mar 28, 2025

Describe your PR, what does it fix/add?

This pull requests adds the server implementation of the hyprland-toplevel-mapping-v1 protocol introduced in hyprwm/hyprland-protocols#16

Related:

close #9381

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Is it ready for merging, or does it need work?

Ready for merge

@WhySoBad
Copy link
Contributor Author

WhySoBad commented Apr 3, 2025

Hi,

Sorry for adding all labels, I accidentally rebased and pushed which triggered the bot.

Anyways, I don't know how to fix the meson setup and Nix CI errors. I'd appreciate if someone could help me in this matter :)

@fufexan
Copy link
Member

fufexan commented Apr 3, 2025

Can you rebase on main? Should fix the Nix CI. Don't know what's up with the Arch Meson CI.

@WhySoBad WhySoBad force-pushed the hyprland-toplevel-mapping-protocol branch from 1ab6474 to 25a432c Compare April 3, 2025 18:27
@WhySoBad
Copy link
Contributor Author

WhySoBad commented Apr 3, 2025

I think the problem with the Nix build is that the hyprland-protocols revision is locked? However, I don't know anything about Nix so this is only a guess

@fufexan
Copy link
Member

fufexan commented Apr 3, 2025

Yeah, seems like your fixup commit came later than my flake bump.

@WhySoBad
Copy link
Contributor Author

WhySoBad commented Apr 4, 2025

Yeah, seems like your fixup commit came later than my flake bump.

Oh sorry, didn't notice you bumped the flake.

I think you'll need to bump it again for hyprland-protocols 0.6.4 which includes the protocol in it's meson build.

Thanks for the help :)

@vaxerski vaxerski removed the Nix label Apr 5, 2025
@@ -168,3 +168,14 @@ void CForeignToplevelProtocol::destroyHandle(CForeignToplevelHandle* handle) {
bool CForeignToplevelProtocol::windowValidForForeign(PHLWINDOW pWindow) {
return validMapped(pWindow) && !pWindow->isX11OverrideRedirect();
}

PHLWINDOW CForeignToplevelProtocol::windowFromHandleResource(wl_resource* res) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sucks, as it's slow and unintuitive. See e.g. CWLSurface::fromResource for how to do it right.

Copy link
Contributor Author

@WhySoBad WhySoBad Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright, changed it. I also changed it for the wlr toplevel handle which already had this method implemented in the same way I did

void destroyHandle(CHyprlandToplevelWindowMappingHandleV1* handle);

std::vector<UP<CToplevelMappingManager>> m_vManagers;
std::vector<SP<CHyprlandToplevelWindowMappingHandleV1>> m_vHandles;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't rawdog resource types, please. Wrap it like you did for the manager

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@WhySoBad WhySoBad requested a review from vaxerski April 6, 2025 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to get window for toplevel handle
3 participants