aboutsummaryrefslogtreecommitdiffstats
path: root/swaynag
Commit message (Collapse)AuthorAge
* Define _POSIX_C_SOURCE globallyLibravatar Simon Ser2024-02-23
| | | | See discussion in https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4555
* swaynag/config.c: fix build against gcc-14 (-Walloc-size)Libravatar Sergei Trofimovich2023-11-03
| | | | | | | | | | | | | | `gcc-14` added a new `-Walloc-size` warning that makes sure that size of an individual element matches size of a pointed type: https://gcc.gnu.org/PR71219 `sway` triggers it on `calloc()` calls where member size is used as `1` (instead of member count): swaynag/config.c:169:65: error: allocation of insufficient size '1' for type 'struct swaynag_button' with size '48' [-Werror=alloc-size] 169 | struct swaynag_button *button = calloc(sizeof(struct swaynag_button), 1);
* swaynag: Implement wp_cursor_shape_v1Libravatar Alexander Orzechowski2023-07-31
|
* swaynag: handle wayland-cursor failuresLibravatar Simon Ser2023-07-17
| | | | | | | Same as 92244c87dbb8 ("swaybar: handle wayland-cursor failures") but for swaynag. Closes: https://github.com/swaywm/sway/issues/7671
* Use "default" XCursor instead of "left_ptr"Libravatar Simon Ser2023-06-25
| | | | | "left_ptr" is the legacy XCursor name. "default" is the cursor spec name.
* swaynag: call swaynag_destroy on clean exitLibravatar Manuel Stoeckl2023-01-16
| | | | | | | | | | | 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.
* swaynag: drop swaynag_type.fontLibravatar Simon Ser2022-12-22
| | | | It's too easy to have this go out of sync with font_description.
* swaynag: fix NULL font descriptionLibravatar Simon Ser2022-12-22
| | | | | | | The font description was only set if provided on the CLI. It was left NULL for the defaults and when reading from the config file. Closes: https://github.com/swaywm/sway/issues/7186
* Fix build on Debian StableLibravatar nerdopolis2022-11-28
|
* build: drop intermediate libraries for protocolsLibravatar Simon Ser2022-11-25
|
* Reuse parsed PangoFontDescriptionLibravatar Hugo Osvaldo Barrera2022-07-01
| | | | Avoids parsing the configured font each time text is rendered.
* swaynag: move close_button up to fix SIGSEGVLibravatar Greg Depoire--Ferrer2022-06-05
| | | | | | | | | | | | | | | | | | 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 4780afb68b4ee2cdf0e4925f40cf885819f8a74a ("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.
* swaynag: combine consecutive declaration/assignmentsLibravatar Nihal Jere2022-05-07
|
* swaynag: improve robustness when loading configLibravatar Nihal Jere2022-05-07
|
* swaynag: do error checking and rename read_from_stdinLibravatar Nihal Jere2022-05-07
| | | | | read_from_stdin not only read from stdin, but trimming trailing newlines, so rename it to reflect this.
* remove unnecessary strlen callLibravatar Nihal Jere2022-03-15
|
* swaynag: remove redundant status variables in mainLibravatar Nihal Jere2022-03-15
| | | | Instead, we just use `status` for all failures.
* swaynag: remove unnecessary zero of swaynag structLibravatar Nihal Jere2022-03-15
| | | | Global variables are initialized to 0.
* swaynag: statically allocate button_close, and move declarationLibravatar Nihal Jere2022-03-15
| | | | | | 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.
* swaynag: allocate button_details with detailsLibravatar Nihal Jere2022-03-15
| | | | | They are used together, so it doesn't make sense to allocate them separately.
* swaynag: die on all allocation failuresLibravatar Nihal Jere2022-02-28
|
* Remove all sprintf callsLibravatar Simon Ser2022-02-08
| | | | | Replace them with snprintf, which ensures buffer overflows won't happen.
* swaynag: remove buffer destruction conditionLibravatar Kirill Primak2022-01-23
| | | | | | | | An address of a variable can never be NULL, so checking it doesn't make sense; and `destroy_buffer()` can operate on already destroyed buffers anyway. Fixes #6780
* swaynag: remove xdg-output logicLibravatar Simon Ser2021-12-13
| | | | | We can just get the output name from wl_output directly, now that wl_output version 4 exists.
* swaynag: fix pointer button events on scaled outputsLibravatar xdavidwu2021-09-13
| | | | | | | sway#6504 simplified rendering code by setting scaling at cairo, but that also changed button position records into ones without scale multiplication, breaking button events. This fixes it by not multiplying scale on events handling as well.
* Rename pango_printf to render_textLibravatar Simon Ser2021-09-13
| | | | | This avoids using the pango_ prefix, reserved for functions coming from the Pango library.
* Simplify swaybar/swaynag scaling codeLibravatar Caduser20202021-09-12
| | | | | Use `cairo_scale` to set the scale factor, removing redundant multiplications by `output->scale`.
* swaynag: adds option to set wayland shell layerLibravatar James Edwards-Jones2021-06-17
| | | | Uses --layer/-y set to overlay|top|bottom|background
* details-gackground typo fixLibravatar sergio2021-05-28
|
* cairo: Replace <cairo/cairo.h> by <cairo.h>Libravatar Issam E. Maghni2021-05-10
| | | | | | | For full context, read https://gitlab.freedesktop.org/cairo/cairo/-/issues/479 TL;DR, cairo’s pc file adds `/cairo` to CFLAGS. So namespace cairo shouldn’t be used.
* Use execlp("sh") instead of execl("/bin/sh")Libravatar Simon Ser2021-04-22
| | | | This stops assuming the POSIX shell command is located in /bin.
* swaynag: Use position from wl_pointer.enterLibravatar Kenny Levinsen2021-02-07
| | | | | | | | | | Only wl_pointer.motion was used to update pointer position, which would cause issues if the pointer was not moved prior to wl_pointer.button. This also fixes touch input through wl_pointer emulation, which fires wl_pointer.button immediately after wl_pointer.enter. Closes: https://github.com/swaywm/sway/issues/5991
* Make command line option lists constLibravatar Manuel Stoeckl2021-02-04
|
* Make Wayland request listeners static const when possibleLibravatar Manuel Stoeckl2021-02-04
|
* Changed fprintf(stdout,...) to printf(...) for more readable codeLibravatar SpizzyCoder2021-01-16
|
* swaynag: add details background optionLibravatar Mustafa Abdul-Kader2020-09-14
| | | | | | Adds a new config option for details background for swaynag issue/#5673
* swaynag: adds option to separately specify the text color for buttonsLibravatar oliver-giersch2020-09-04
|
* Fix incorrect format specifiersLibravatar Antonin Décimo2020-07-30
|
* swaynag: sway_abort on failure to properly registerLibravatar Luke Drummond2020-06-10
| | | | | | | | | In case `wl_display_roundtrip` returns an error after registering for events, print a more user-friendly error message and exit. Previously, if the build did not have assertions enabled, this would likely result in a segfault. With assertions enabled, it's not user friendly to terminate with internal implementation information.
* swaynag: allow specifying more buttons which execute and dismissLibravatar Graham Christensen2020-06-09
| | | | | I don't love -z / -Z, but I figure this patch is far from being accepted for other reasons too.
* swaynag: exit on wl_display_roundtrip errorLibravatar Dominique Martinet2020-04-02
| | | | | fixes loop when sway closes the socket in the middle of querying outputs, see #5138.
* swaynag: fix segfault on exit when arguments are not correctLibravatar Dominique Martinet2020-03-29
| | | | | swaynag_destroy is called on all cleanup cases and needs the lists to be valid, just init them early
* swaynag: Add multi-seat supportLibravatar Andri Yngvason2020-01-05
| | | | This also adds cleanup for all seat resources
* parse_color: return success + drop fallback colorLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | This is the first in a series of commits to refactor the color handling in sway. This changes parse_color to return whether it was success and no longer uses 0xFFFFFFFF as the fallback color. This also verifies that the string actually contains a valid hexadecimal number along with the length checks. In the process of altering the calls to parse_color, I also took the opportunity to heavily refactor swaybar's ipc_parse_colors function. This allowed for several lines of duplicated code to be removed.
* Fix markup syntax in man pagesLibravatar Martin Michlmayr2019-08-31
|
* check for empty string before calling strtoul() and check errnoLibravatar Daniel Eklöf2019-06-05
| | | | | | Note: since strtoul() has no real error return code (both 0 and ULONG_MAX may be returned on both success and failure), set errno=0 before calling strtoul().
* swaybar/nag: use xcursor theme defined by XCURSOR_THEME/SIZELibravatar Daniel Eklöf2019-06-05
| | | | | | | | If the XCURSOR_THEME and/or XCURSOR_SIZE environment variables are set, use the theme and size they define. If they're not set, use the same defaults as before (system default theme, size=24).
* swaybg: split into standalone projectLibravatar Drew DeVault2019-04-25
| | | | | | | The new upstream is https://github.com/swaywm/swaybg This commit also refactors our use of gdk-pixbuf a bit, since the only remaining reverse dependency is swaybar tray support.
* swaynag: revamp type configsLibravatar Brian Ashworth2019-04-20
| | | | | | | | | | | | | 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.
* Spawn swaynag as a wayland clientLibravatar Brian Ashworth2019-04-14
| | | | | This spawns swaynag as a wayland client similar to how swaybar and swaybg are already done