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

Allow WlSubsurfaces to be placed explicitly relative to hierarchy #2487

Closed
fredldotme opened this issue Jun 22, 2022 · 4 comments · May be fixed by #2491
Closed

Allow WlSubsurfaces to be placed explicitly relative to hierarchy #2487

fredldotme opened this issue Jun 22, 2022 · 4 comments · May be fixed by #2491

Comments

@fredldotme
Copy link

Wayland has some protocols to handle the explicit placement of WlSubsurfaces:

  • above or below siblings
  • even above or below the parent surface

I've started implementing a change for the first use-case since, as far as I see, making it work with the parent surface would involve at least sneaking another dummy WlSurface in between. I believe even Weston does something similar to that.

The initial change is here. I've not opened a PR yet since I would like to get some input around the big picture before continuing with this. Details can still be talked about in a PR.

fredldotme/mir-experimental@ed3c67e

@wmww
Copy link
Contributor

wmww commented Jun 23, 2022

Hi, sorry for not getting back sooner.

Here are some notes:

  • I don't see the implementation of the new set_subsurface() method
  • move_child_above_sibling()/*_below_* seem a bit complicated and verbose, but maybe there's not a simpler way.
  • I don't see where the new parent member is being initialized (and thus why it needs to be a unique_ptr with a custom deleter).

If you're interested in getting this into upstream Mir, I encourage you to open a draft PR based on current main for easier review (the parent of the linked commit seems to be originally from 2020). I don't think much has changed in the subsurface code since then so hopefully that will not be hard.

@fredldotme
Copy link
Author

  • That one is right in the header. Can put it in the .cpp if preferred.
  • Agreed
  • parent is initialized somewhere else, but we need it to get to the siblings which is why I turned it into a public member. If preferred I can also try keeping the parent private and find a way to get to the siblings more easily.

This is actually something I'm working on for Waydroid on Ubuntu Touch, which is why this is based on 1.x still. My goal is to let it trickle down from 2.x to 1.x finally, but I need something to test it with.

If the general approach is fine I will go on and make it ready for 2.x.

@wmww
Copy link
Contributor

wmww commented Jun 23, 2022

I took a stab at implementing this, see #2491.

@wmww
Copy link
Contributor

wmww commented Sep 22, 2022

Dup of #345.

@wmww wmww closed this as completed Sep 22, 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 a pull request may close this issue.

2 participants