security-context: constify lookup_client()

This is worth doing despite wl_client_get_destroy_listener() incorrectly
accepting a mutable wl_client pointer since this lookup_client()
function will primarily be used with a wl_display_global_filter_func_t
which only provides a const wl_client pointer.

Work around this libwayland API wart in wlroots so compositors don't
have to.
This commit is contained in:
Isaac Freund 2024-03-15 13:38:30 +01:00 committed by Simon Ser
parent c5eda09166
commit 5a5aa72571
2 changed files with 3 additions and 3 deletions

View File

@ -50,6 +50,6 @@ struct wlr_security_context_v1_commit_event {
struct wlr_security_context_manager_v1 *wlr_security_context_manager_v1_create(
struct wl_display *display);
const struct wlr_security_context_v1_state *wlr_security_context_manager_v1_lookup_client(
struct wlr_security_context_manager_v1 *manager, struct wl_client *client);
struct wlr_security_context_manager_v1 *manager, const struct wl_client *client);
#endif

View File

@ -429,8 +429,8 @@ struct wlr_security_context_manager_v1 *wlr_security_context_manager_v1_create(
}
const struct wlr_security_context_v1_state *wlr_security_context_manager_v1_lookup_client(
struct wlr_security_context_manager_v1 *manager, struct wl_client *client) {
struct wl_listener *listener = wl_client_get_destroy_listener(client,
struct wlr_security_context_manager_v1 *manager, const struct wl_client *client) {
struct wl_listener *listener = wl_client_get_destroy_listener((struct wl_client *)client,
security_context_client_handle_destroy);
if (listener == NULL) {
return NULL;