-
Notifications
You must be signed in to change notification settings - Fork 123
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
Proxy tags #705
Comments
Mostly, the core question I'd have is: do you have some use-case in mind for this? My understanding is that such tags are useful as a way to bring back some semblance of type-safety in the mix, allowing to "typecheck" a proxy before trying to access its user-data. However wayland-rs already provides means to do so, thanks to the Rust type system. So yeah, what kind of usecase would that cover that is not already covered by the wayland-rs API? |
I need a way to check "Is this surface part of an SCTK frame?", and this seems like the best way, as it requires no knowledge of the surface's user data type. EDIT: Note that this is intended for a future PR that introduces some backend work that will make implementing subsurfaces and popups easier in |
This is an API that should be trivial for SCTK itself to provide though, without requiring any change to wayland-rs |
relevant docs: https://wayland.freedesktop.org/docs/html/apb.html#Client-classwl__proxy
libwayland-client
offers functions for associating a tag with a proxy:const char* const* wl_proxy_get_tag(struct wl_proxy* proxy)
void wl_proxy_set_tag(struct wl_proxy* proxy, const char* const* tag)
According to the docs, one obtains the
const char* const*
by creating a const C string, then taking a pointer to that pointer:I'm opening this issue to discuss how we could wrap this functionality into a safe Rust API. I don't believe there's a nice way to convert
&'static &'static ::std::ffi::CStr
to the corresponding pointer.The text was updated successfully, but these errors were encountered: