From 7ed60c54a0b7c10a0f70f54320e270691d40d673 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Sat, 8 Jan 2022 22:52:59 +0300 Subject: [PATCH] xdg-surface: avoid emitting signals with their owner object https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1008#note_1139647 --- types/xdg_shell/wlr_xdg_shell.c | 2 +- types/xdg_shell/wlr_xdg_surface.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/types/xdg_shell/wlr_xdg_shell.c b/types/xdg_shell/wlr_xdg_shell.c index 0480d5f3..0b130262 100644 --- a/types/xdg_shell/wlr_xdg_shell.c +++ b/types/xdg_shell/wlr_xdg_shell.c @@ -84,7 +84,7 @@ static int xdg_client_ping_timeout(void *user_data) { struct wlr_xdg_surface *surface; wl_list_for_each(surface, &client->surfaces, link) { - wlr_signal_emit_safe(&surface->events.ping_timeout, surface); + wlr_signal_emit_safe(&surface->events.ping_timeout, NULL); } client->ping_serial = 0; diff --git a/types/xdg_shell/wlr_xdg_surface.c b/types/xdg_shell/wlr_xdg_surface.c index eb986104..a9f7aa82 100644 --- a/types/xdg_shell/wlr_xdg_surface.c +++ b/types/xdg_shell/wlr_xdg_surface.c @@ -37,7 +37,7 @@ void unmap_xdg_surface(struct wlr_xdg_surface *surface) { // TODO: probably need to ungrab before this event if (surface->mapped) { - wlr_signal_emit_safe(&surface->events.unmap, surface); + wlr_signal_emit_safe(&surface->events.unmap, NULL); } switch (surface->role) { @@ -312,7 +312,7 @@ void xdg_surface_role_commit(struct wlr_surface *wlr_surface) { if (surface->configured && wlr_surface_has_buffer(surface->surface) && !surface->mapped) { surface->mapped = true; - wlr_signal_emit_safe(&surface->events.map, surface); + wlr_signal_emit_safe(&surface->events.map, NULL); } } @@ -405,7 +405,7 @@ void reset_xdg_surface(struct wlr_xdg_surface *surface) { } if (surface->added) { - wlr_signal_emit_safe(&surface->events.destroy, surface); + wlr_signal_emit_safe(&surface->events.destroy, NULL); surface->added = false; }