mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
xdg-system-bell-v1: set proper global/resource user data
See https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3963.
This commit is contained in:
parent
0bf0c55ad2
commit
9c9bf2efee
1 changed files with 4 additions and 2 deletions
|
|
@ -40,13 +40,15 @@ static const struct xdg_system_bell_v1_interface bell_impl = {
|
||||||
|
|
||||||
static void bell_bind(struct wl_client *client, void *data,
|
static void bell_bind(struct wl_client *client, void *data,
|
||||||
uint32_t version, uint32_t id) {
|
uint32_t version, uint32_t id) {
|
||||||
|
struct wlr_xdg_system_bell_v1 *bell = data;
|
||||||
|
|
||||||
struct wl_resource *resource = wl_resource_create(client,
|
struct wl_resource *resource = wl_resource_create(client,
|
||||||
&xdg_system_bell_v1_interface, version, id);
|
&xdg_system_bell_v1_interface, version, id);
|
||||||
if (resource == NULL) {
|
if (resource == NULL) {
|
||||||
wl_client_post_no_memory(client);
|
wl_client_post_no_memory(client);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wl_resource_set_implementation(resource, &bell_impl, NULL, NULL);
|
wl_resource_set_implementation(resource, &bell_impl, bell, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
||||||
|
|
@ -71,7 +73,7 @@ struct wlr_xdg_system_bell_v1 *wlr_xdg_system_bell_v1_create(struct wl_display *
|
||||||
}
|
}
|
||||||
|
|
||||||
bell->global = wl_global_create(display, &xdg_system_bell_v1_interface,
|
bell->global = wl_global_create(display, &xdg_system_bell_v1_interface,
|
||||||
version, NULL, bell_bind);
|
version, bell, bell_bind);
|
||||||
if (bell->global == NULL) {
|
if (bell->global == NULL) {
|
||||||
free(bell);
|
free(bell);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue