aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/swaynag/swaynag.h3
1 files changed, 2 insertions, 1 deletions
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 {
58struct swaynag_details { 58struct swaynag_details {
59 bool visible; 59 bool visible;
60 char *message; 60 char *message;
61 char *details_text;
61 62
62 int x; 63 int x;
63 int y; 64 int y;
@@ -67,7 +68,7 @@ struct swaynag_details {
67 int offset; 68 int offset;
68 int visible_lines; 69 int visible_lines;
69 int total_lines; 70 int total_lines;
70 struct swaynag_button button_details; 71 struct swaynag_button *button_details;
71 struct swaynag_button button_up; 72 struct swaynag_button button_up;
72 struct swaynag_button button_down; 73 struct swaynag_button button_down;
73}; 74};