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.
master
Isaac Freund 9 months ago committed by Simon Ser
parent c5eda09166
commit 5a5aa72571

@ -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

@ -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;

Loading…
Cancel
Save