~ruther/dwl

aa69ed81b558f74e470e69cdcd442f9048ee624c — korei999 8 months ago d1c2f43
allocate with LISTEN_STATIC

Fixes: https://codeberg.org/dwl/dwl/issues/723
Supersedes: https://codeberg.org/dwl/dwl/pulls/724
1 files changed, 4 insertions(+), 1 deletions(-)

M dwl.c
M dwl.c => dwl.c +4 -1
@@ 79,7 79,7 @@
#define END(A)                  ((A) + LENGTH(A))
#define TAGMASK                 ((1u << TAGCOUNT) - 1)
#define LISTEN(E, L, H)         wl_signal_add((E), ((L)->notify = (H), (L)))
#define LISTEN_STATIC(E, H)     do { static struct wl_listener _l = {.notify = (H)}; wl_signal_add((E), &_l); } while (0)
#define LISTEN_STATIC(E, H)     do { struct wl_listener *_l = ecalloc(1, sizeof(*_l)); _l->notify = (H); wl_signal_add((E), _l); } while (0)

/* enums */
enum { CurNormal, CurPressed, CurMove, CurResize }; /* cursor */


@@ 906,6 906,7 @@ commitpopup(struct wl_listener *listener, void *data)
	box.y -= (type == LayerShell ? l->scene->node.y : c->geom.y);
	wlr_xdg_popup_unconstrain_from_box(popup, &box);
	wl_list_remove(&listener->link);
	free(listener);
}

void


@@ 1246,6 1247,7 @@ destroydragicon(struct wl_listener *listener, void *data)
	focusclient(focustop(selmon), 1);
	motionnotify(0, NULL, 0, 0, 0, 0);
	wl_list_remove(&listener->link);
	free(listener);
}

void


@@ 1255,6 1257,7 @@ destroyidleinhibitor(struct wl_listener *listener, void *data)
	 * at this point the idle inhibitor is still in the list of the manager */
	checkidleinhibitor(wlr_surface_get_root_surface(data));
	wl_list_remove(&listener->link);
	free(listener);
}

void