From 5e73acb431258d81a01709fbd28da2e151bd3bd3 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Sun, 8 Jan 2023 09:21:30 -0500 Subject: swaynag: call swaynag_destroy on clean exit And fix the fallout of the swaynag_destroy having evolved without being tested: * wl_display_disconnect was called too early * `button_close` and `swaynag.details.button_details` needed to be heap allocated, since they are added to swaynag.buttons, and all entries of swaynag.buttons are freed in swaynag_destroy * To keep things simpler, disconnect the lifetime of the 'Toggle details' button text config setting from the button itself. --- include/swaynag/swaynag.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/swaynag') diff --git a/include/swaynag/swaynag.h b/include/swaynag/swaynag.h index 2d68b6c9..ccd313a0 100644 --- a/include/swaynag/swaynag.h +++ b/include/swaynag/swaynag.h @@ -58,6 +58,7 @@ struct swaynag_button { struct swaynag_details { bool visible; char *message; + char *details_text; int x; int y; @@ -67,7 +68,7 @@ struct swaynag_details { int offset; int visible_lines; int total_lines; - struct swaynag_button button_details; + struct swaynag_button *button_details; struct swaynag_button button_up; struct swaynag_button button_down; }; -- cgit v1.2.3-54-g00ecf