diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-04-17 21:27:12 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-04-17 21:27:12 +0200 |
| commit | 1222dae9b478619b9a53e4d51061edafa2a6334c (patch) | |
| tree | 581bc7d859e5259f0380b8a583892130660d6ed0 /dbar.c | |
| parent | 22641740571a7c04186e6cff689f2ac8bbddece7 (diff) | |
fix wl_output register bug
Diffstat (limited to 'dbar.c')
| -rw-r--r-- | dbar.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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"); } |