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 xdg-foreign protocol #342

Merged
merged 1 commit into from
Jul 31, 2021
Merged

Conversation

i509VCB
Copy link
Member

@i509VCB i509VCB commented Jul 22, 2021

Implementation of the xdg-foreign protocol. This allows a client to export a surface and then allow another import the surface using a handle.

So what's needed otherwise:

  • New release of wayland-rs so the error types from xdg-foreign are accessible. Rebased on Update dependencies #343
  • Implement the parent relationship logic. Untested atm

@i509VCB i509VCB changed the title xdg-foreign: the initial steps [wip] xdg-foreign: the initial steps Jul 22, 2021
@i509VCB i509VCB force-pushed the xdg-foreign branch 2 times, most recently from 3d8277b to 958219e Compare July 25, 2021 03:18
@i509VCB i509VCB changed the title [wip] xdg-foreign: the initial steps Implement xdg-foreign protocol Jul 25, 2021
@i509VCB i509VCB marked this pull request as ready for review July 25, 2021 03:20
Copy link
Member

@elinorbgr elinorbgr left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, the general structure looks good, I just have a few remarks. This will need to be rebased on master as well.

@i509VCB
Copy link
Member Author

i509VCB commented Jul 25, 2021

@vberger I think I've resolved your requests here.

@elinorbgr
Copy link
Member

Hmm, so, seen how you changed your PR, it looks like you missed the fact that there are two different roles XDG_TOPLEVEL_ROLE and ZXDG_TOPLEVEL_ROLE for the xdg-shell and zxdg_shell_v6 protocols, rather than a single unified role for both.

Taking that into account, I don't think it's necessarily a good idea to move one of them in xdg/mod.rs, and then use only that in the checks of toplevel_like().

@i509VCB
Copy link
Member Author

i509VCB commented Jul 25, 2021

Hmm I probably need to make sure I did fully implement the wl_shell_surface parent logic

@i509VCB i509VCB force-pushed the xdg-foreign branch 2 times, most recently from e2be507 to 287aee1 Compare July 30, 2021 01:37
@i509VCB i509VCB force-pushed the xdg-foreign branch 2 times, most recently from 2dcc6fa to 26e3746 Compare July 31, 2021 03:43
This is very much incomplete, but it implements the import and export of surfaces. However functions related to setting and imported surface the parent of another surface is not done.

importer destructor destroys all imports made from the same client 


Implement SetParentOf, no undoing yet


Add inner import type


Destroy child surface relationships when importing


A note


move init function upwards


use 0.29.0 crate


Move role string constants into the public


Use toplevel_like for surface checks in foreign


add methods to get the parent surface


Make sure ZXDG roles are public api


Consistent ordering of parameters on xdg_foreign impl methods


Let's update the changelog


Document how to use xdg_foreign


wl_shell_surface is likely invalid, so it cannot be imported or exported


Changelog suggestions


remove redundant inner ref cell


Remove all uses of the refcell like behavior


Allow compositor to export surfaces on server



Appease new clippy lints


then


Use string references and iterate in reverse to simplify removals


heed request for order
@elinorbgr elinorbgr merged commit 23a8af3 into Smithay:master Jul 31, 2021
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