aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag/config.c
diff options
context:
space:
mode:
authorLibravatar Manuel Stoeckl <code@mstoeckl.com>2023-01-08 09:21:30 -0500
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2023-01-16 10:47:42 -0500
commit5e73acb431258d81a01709fbd28da2e151bd3bd3 (patch)
tree94b773c7ff37dfe45c6e99cfaecff98927bf0b8b /swaynag/config.c
parentinput: enable user xkb configs with cap_sys_nice (diff)
downloadsway-5e73acb431258d81a01709fbd28da2e151bd3bd3.tar.gz
sway-5e73acb431258d81a01709fbd28da2e151bd3bd3.tar.zst
sway-5e73acb431258d81a01709fbd28da2e151bd3bd3.zip
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.
Diffstat (limited to 'swaynag/config.c')
-rw-r--r--swaynag/config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/swaynag/config.c b/swaynag/config.c
index 6c8c26fc..6d39f342 100644
--- a/swaynag/config.c
+++ b/swaynag/config.c
@@ -243,8 +243,8 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag,
243 break; 243 break;
244 case 'L': // Detailed Button Text 244 case 'L': // Detailed Button Text
245 if (swaynag) { 245 if (swaynag) {
246 free(swaynag->details.button_details.text); 246 free(swaynag->details.details_text);
247 swaynag->details.button_details.text = strdup(optarg); 247 swaynag->details.details_text = strdup(optarg);
248 } 248 }
249 break; 249 break;
250 case 'm': // Message 250 case 'm': // Message