Skip to content
New issue

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

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

Already on GitHub? # to your account

RegistryState/GlobalList redundancy #324

Open
MaxVerevkin opened this issue Nov 28, 2022 · 4 comments
Open

RegistryState/GlobalList redundancy #324

MaxVerevkin opened this issue Nov 28, 2022 · 4 comments

Comments

@MaxVerevkin
Copy link
Contributor

From what I understand, right now global handling is done in multiple steps:

  1. waylad_client: GlobalList intercepts events and fills it's internal Mutex<Vec<Global>>. After the initial roundtrip it starts propagating new events.
  2. client-toolkit: RegistryState clones the list of globals from GlobalList and keeps it in sync.

It seems that having two copies of Vec<Global> is redundant.

@ids1024
Copy link
Member

ids1024 commented Dec 5, 2022

I'm not sure there's a way to avoid some kind of redundancy here as long as wayland_client has a helper related to globals, and sctk needs a helper that provides additional functionality (for hotpluggable globals).

But it would be good to improve this if anyone has ideas.

@i509VCB
Copy link
Member

i509VCB commented Dec 6, 2022

I don't see a way we can remove this redundancy without expanding wayland-client's helpers into this scope or tell users of sctk to manually instantiate globals like wl_output

@ids1024
Copy link
Member

ids1024 commented Dec 15, 2022

I guess this abstraction is useful in wayland-rs for things that are using wayland-rs without sctk?

Assuming it's thus necessary to have in client-toolkit, there might be a couple options:

  • Just don't use this wayland-client feature in sctk, and duplicate it (or wrap the wayland-client version, so the user of sctk doesn't directly call it)
  • Expand the scope of this in wayland-client in some way, and remove the need for a registry helper type in sctk
    • This seems to blur the boundry of what's in scope for wayland-client and for sctk

@axelkar
Copy link

axelkar commented Dec 7, 2024

Can someone tell me, is there a way to get globals using a raw display handle (backend is not owned) and without starting a full event loop (I'm thinking it's going to catch unrelated events too)? Is there a way to get globals without using get_registry, as it's not recommended to request multiple times? Should I use wayland-client or sctk?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants