diff options
author | 2018-08-25 13:06:04 +1000 | |
---|---|---|
committer | 2018-08-25 13:06:04 +1000 | |
commit | 4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9 (patch) | |
tree | f1ed7e866d4e34f5ef9b8f72ec8095369619aaa7 /swaynag | |
parent | commands: implement move absolute (diff) | |
parent | Merge pull request #2499 from RyanDwyer/refactor-destroy-functions (diff) | |
download | sway-4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9.tar.gz sway-4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9.tar.zst sway-4b9ad9c2382db9b2a9a224e9ebc60b6298843aa9.zip |
Merge branch 'master' into commands
Diffstat (limited to 'swaynag')
-rw-r--r-- | swaynag/config.c | 4 | ||||
-rw-r--r-- | swaynag/main.c | 15 |
2 files changed, 11 insertions, 8 deletions
diff --git a/swaynag/config.c b/swaynag/config.c index d6c5739d..4d0824c9 100644 --- a/swaynag/config.c +++ b/swaynag/config.c | |||
@@ -180,8 +180,8 @@ int swaynag_parse_options(int argc, char **argv, struct swaynag *swaynag, | |||
180 | break; | 180 | break; |
181 | case 'L': // Detailed Button Text | 181 | case 'L': // Detailed Button Text |
182 | if (swaynag) { | 182 | if (swaynag) { |
183 | free(swaynag->details.button_details.text); | 183 | free(swaynag->details.button_details->text); |
184 | swaynag->details.button_details.text = strdup(optarg); | 184 | swaynag->details.button_details->text = strdup(optarg); |
185 | } | 185 | } |
186 | break; | 186 | break; |
187 | case 'm': // Message | 187 | case 'm': // Message |
diff --git a/swaynag/main.c b/swaynag/main.c index 6b0b5236..d1a0d236 100644 --- a/swaynag/main.c +++ b/swaynag/main.c | |||
@@ -34,9 +34,10 @@ int main(int argc, char **argv) { | |||
34 | button_close->type = SWAYNAG_ACTION_DISMISS; | 34 | button_close->type = SWAYNAG_ACTION_DISMISS; |
35 | list_add(swaynag.buttons, button_close); | 35 | list_add(swaynag.buttons, button_close); |
36 | 36 | ||
37 | swaynag.details.button_details.text = strdup("Toggle Details"); | 37 | swaynag.details.button_details = |
38 | swaynag.details.button_details.type = SWAYNAG_ACTION_EXPAND; | 38 | calloc(sizeof(struct swaynag_button), 1); |
39 | 39 | swaynag.details.button_details->text = strdup("Toggle Details"); | |
40 | swaynag.details.button_details->type = SWAYNAG_ACTION_EXPAND; | ||
40 | 41 | ||
41 | char *config_path = NULL; | 42 | char *config_path = NULL; |
42 | bool debug = false; | 43 | bool debug = false; |
@@ -99,9 +100,10 @@ int main(int argc, char **argv) { | |||
99 | swaynag_types_free(types); | 100 | swaynag_types_free(types); |
100 | 101 | ||
101 | if (swaynag.details.message) { | 102 | if (swaynag.details.message) { |
102 | list_add(swaynag.buttons, &swaynag.details.button_details); | 103 | list_add(swaynag.buttons, swaynag.details.button_details); |
103 | } else { | 104 | } else { |
104 | free(swaynag.details.button_details.text); | 105 | free(swaynag.details.button_details->text); |
106 | free(swaynag.details.button_details); | ||
105 | } | 107 | } |
106 | 108 | ||
107 | wlr_log(WLR_DEBUG, "Output: %s", swaynag.type->output); | 109 | wlr_log(WLR_DEBUG, "Output: %s", swaynag.type->output); |
@@ -123,7 +125,8 @@ int main(int argc, char **argv) { | |||
123 | 125 | ||
124 | cleanup: | 126 | cleanup: |
125 | swaynag_types_free(types); | 127 | swaynag_types_free(types); |
126 | free(swaynag.details.button_details.text); | 128 | free(swaynag.details.button_details->text); |
129 | free(swaynag.details.button_details); | ||
127 | swaynag_destroy(&swaynag); | 130 | swaynag_destroy(&swaynag); |
128 | return exit_code; | 131 | return exit_code; |
129 | } | 132 | } |