aboutsummaryrefslogtreecommitdiff
path: root/swaynag/main.c
AgeCommit message (Collapse)AuthorLines
2025-11-20swaynag/main: free config_pathFurkan Sahin-0/+1
Otherwise config_path is never free'd
2025-04-27Replace signal() with sigaction()Furkan Sahin-1/+2
The man page for signal(3) reads: > new applications should use sigaction() rather than signal()
2025-04-17swaymsg, swaynag: drop sway_terminate() definitionsFurkan Sahin-5/+0
These are unused.
2024-02-16Define _POSIX_C_SOURCE globallyFurkan Sahin-1/+0
See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
2023-01-08swaynag: call swaynag_destroy on clean exitFurkan Sahin-11/+10
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.
2022-12-21swaynag: drop swaynag_type.fontFurkan Sahin-1/+3
It's too easy to have this go out of sync with font_description.
2022-06-05swaynag: move close_button up to fix SIGSEGVFurkan Sahin-5/+5
When swaynag_parse_options encounters '--dismiss-button' (or its shorthand '-s'), it sets the text of the first button in the swaynag.buttons list, which is expected to exist and to be the dismiss button, to the one passed by the user. Commit 38288c3916d3d9f33771c220ae307d32e8a208e8 ("swaynag: statically allocate button_close, and move declaration") moved the list initialization to after swaynag_parse_options is called which made that code fail. For example, the command 'swaynag --dismiss-button Dismiss' crashes and 'swaynag --message Message --button Yes "" --dismiss-button Dismiss' shows the wrong buttons. Move it back to before swaynag_parse_options is called.
2022-02-28swaynag: remove redundant status variables in mainFurkan Sahin-14/+10
Instead, we just use `status` for all failures.
2022-02-28swaynag: remove unnecessary zero of swaynag structFurkan Sahin-1/+0
Global variables are initialized to 0.
2022-02-28swaynag: statically allocate button_close, and move declarationFurkan Sahin-10/+5
Every swaynag has a close button, so it doesn't make sense to allocate it dynamically. The declaration is moved later to when it is actually needed.
2022-02-28swaynag: allocate button_details with detailsFurkan Sahin-15/+5
They are used together, so it doesn't make sense to allocate them separately.
2022-02-25swaynag: die on all allocation failuresFurkan Sahin-0/+8
2020-06-04Fix incorrect format specifiersFurkan Sahin-1/+1
2020-03-29swaynag: fix segfault on exit when arguments are not correctFurkan Sahin-0/+2
swaynag_destroy is called on all cleanup cases and needs the lists to be valid, just init them early
2019-04-19swaynag: revamp type configsFurkan Sahin-11/+8
This revamps the type configs for swaynag. All sizing attributes for swaynag are now `ssize_t` instead of `uint32_t` to allow for a default value of `-1`, which allows for `0` to be a valid value. Additionally, the initialization of the type configs has been changed from a simple calloc to use a new function `swaynag_type_new`. `swaynag_type_new` calloc's the memory, checks for an allocation failure, sets the name, and all sizes to -1. The layering order has also been changed to default, general config, type config, and as highest priority command line arguments. Finally, `swaynag_type_merge` has been modified to handle the layering and sizing changes.
2019-01-20Replace wlr_log with sway_logFurkan Sahin-10/+10
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
2018-11-25Replace _XOPEN_SOURCE with _POSIX_C_SOURCEFurkan Sahin-2/+1
And make sure we don't define both in the same source file.
2018-10-07swaynag: s/Toggle Details/Toggle details/Furkan Sahin-1/+1
2018-08-20Fix bad-free in swaynagFurkan Sahin-6/+9
2018-08-03Add missing stdlib.h includes to swaynagFurkan Sahin-0/+1
2018-07-30swaynag: fix hidpiFurkan Sahin-4/+1
2018-07-29swaynag: allow more config optionsFurkan Sahin-10/+23
2018-07-28swaynag: refactor {sway_,}nagbar to swaynagFurkan Sahin-39/+39
2018-07-28swaynag: split config into own file and fix optindFurkan Sahin-289/+7
2018-07-28swaynag: implement config file supportFurkan Sahin-101/+256
2018-07-27Address first round review for swaynagFurkan Sahin-0/+246