From 1262f1b3d14a4f7092dfeb1547dc6752dfa190ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 9 Nov 2020 19:53:57 +0100 Subject: [PATCH] bar/wayland: use wl_*_release() instead of wl_*_destroy() This lets the compositor free up internal state. --- bar/wayland.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bar/wayland.c b/bar/wayland.c index 7d87558..32bd87a 100644 --- a/bar/wayland.c +++ b/bar/wayland.c @@ -124,11 +124,11 @@ seat_destroy(struct seat *seat) if (seat->pointer.theme != NULL) wl_cursor_theme_destroy(seat->pointer.theme); if (seat->wl_pointer != NULL) - wl_pointer_destroy(seat->wl_pointer); + wl_pointer_release(seat->wl_pointer); if (seat->pointer.surface != NULL) wl_surface_destroy(seat->pointer.surface); if (seat->seat != NULL) - wl_seat_destroy(seat->seat); + wl_seat_release(seat->seat); } void * @@ -964,7 +964,7 @@ cleanup(struct bar *_bar) if (mon->xdg != NULL) zxdg_output_v1_destroy(mon->xdg); if (mon->output != NULL) - wl_output_destroy(mon->output); + wl_output_release(mon->output); tll_remove(backend->monitors, it); } @@ -987,8 +987,10 @@ cleanup(struct bar *_bar) wl_shm_destroy(backend->shm); if (backend->registry != NULL) wl_registry_destroy(backend->registry); - if (backend->display != NULL) + if (backend->display != NULL) { + wl_display_flush(backend->display); wl_display_disconnect(backend->display); + } /* Destroyed when freeing buffer list */ bar->pix = NULL;