From 1222dae9b478619b9a53e4d51061edafa2a6334c Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Mon, 17 Apr 2023 21:27:12 +0200 Subject: fix wl_output register bug --- dbar.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dbar.c b/dbar.c index 55a0e88..b2cd27d 100644 --- a/dbar.c +++ b/dbar.c @@ -205,6 +205,7 @@ registry_global(void *data, struct wl_registry *wl_registry, uint32_t name, cons } else if (strcmp(interface, wl_output_interface.name) == 0) { bar = add_bar(); bar->wl_output = wl_registry_bind(wl_registry, name, &wl_output_interface, 1); + bar->registry_name = name; if (ready) { register_bar(bar); @@ -218,6 +219,7 @@ remove_global(void *data, struct wl_registry *wl_registry, uint32_t name) { Bar *bar = bars; Bar *prev = 0; + for (; bar; bar = bar->next) { if (bar->registry_name == name) { if (prev) { @@ -407,12 +409,19 @@ add_bar() void remove_bar(Bar *bar) { + fprintf(stderr, "remove bar 1\n"); wl_surface_destroy(bar->wl_surface); + fprintf(stderr, "remove bar 2\n"); zwlr_layer_surface_v1_destroy(bar->zwlr_surface); + fprintf(stderr, "remove bar 3\n"); wl_output_destroy(bar->wl_output); + fprintf(stderr, "remove bar 4\n"); zdwl_output_v1_destroy(bar->dwl_output); + fprintf(stderr, "remove bar 5\n"); free_drw(bar->canvas); + fprintf(stderr, "remove bar 6\n"); free(bar); + fprintf(stderr, "remove bar 7\n"); } -- cgit v1.2.3-70-g09d2