From c52e01e85f4cdeff4aba234993223a232b9cdfa4 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Wed, 14 Aug 2024 16:21:19 +0300 Subject: [PATCH] xdg-popup: don't set a role resource destroy handler wlr_xdg_surface tracks role resource destruction itself. --- types/xdg_shell/wlr_xdg_popup.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c index 082e06fbb..a718b4528 100644 --- a/types/xdg_shell/wlr_xdg_popup.c +++ b/types/xdg_shell/wlr_xdg_popup.c @@ -361,15 +361,6 @@ static const struct wlr_surface_synced_impl surface_synced_impl = { .state_size = sizeof(struct wlr_xdg_popup_state), }; -static void xdg_popup_handle_resource_destroy(struct wl_resource *resource) { - struct wlr_xdg_popup *popup = - wlr_xdg_popup_from_resource(resource); - if (popup == NULL) { - return; - } - wlr_xdg_popup_destroy(popup); -} - void create_xdg_popup(struct wlr_xdg_surface *surface, struct wlr_xdg_surface *parent, struct wlr_xdg_positioner *positioner, uint32_t id) { if (!wlr_xdg_positioner_is_complete(positioner)) { @@ -409,8 +400,7 @@ void create_xdg_popup(struct wlr_xdg_surface *surface, struct wlr_xdg_surface *p goto error_synced; } wl_resource_set_implementation(surface->popup->resource, - &xdg_popup_implementation, surface->popup, - xdg_popup_handle_resource_destroy); + &xdg_popup_implementation, surface->popup, NULL); surface->role = WLR_XDG_SURFACE_ROLE_POPUP;