xdg-surface: avoid emitting signals with their owner object

https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1008#note_1139647
This commit is contained in:
Kirill Primak 2022-01-08 22:52:59 +03:00
parent 6ed3b02775
commit 7ed60c54a0
2 changed files with 4 additions and 4 deletions

View file

@ -84,7 +84,7 @@ static int xdg_client_ping_timeout(void *user_data) {
struct wlr_xdg_surface *surface; struct wlr_xdg_surface *surface;
wl_list_for_each(surface, &client->surfaces, link) { 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; client->ping_serial = 0;

View file

@ -37,7 +37,7 @@ void unmap_xdg_surface(struct wlr_xdg_surface *surface) {
// TODO: probably need to ungrab before this event // TODO: probably need to ungrab before this event
if (surface->mapped) { if (surface->mapped) {
wlr_signal_emit_safe(&surface->events.unmap, surface); wlr_signal_emit_safe(&surface->events.unmap, NULL);
} }
switch (surface->role) { 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) && if (surface->configured && wlr_surface_has_buffer(surface->surface) &&
!surface->mapped) { !surface->mapped) {
surface->mapped = true; 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) { if (surface->added) {
wlr_signal_emit_safe(&surface->events.destroy, surface); wlr_signal_emit_safe(&surface->events.destroy, NULL);
surface->added = false; surface->added = false;
} }