aboutsummaryrefslogtreecommitdiff
path: root/swaynag
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-12-21 11:22:21 +0100
committerSimon Ser <contact@emersion.fr>2022-12-22 17:42:33 +0100
commitfd0af78e43f4dd67a404f475c676b25ae38a4b82 (patch)
tree3b4ca1e33e501ac3da269a53991f902a6557c7c0 /swaynag
parent1ade0ce753dc5f588584f444ce80d27c3b1e4300 (diff)
swaynag: fix NULL font description
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
Diffstat (limited to 'swaynag')
-rw-r--r--swaynag/types.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/swaynag/types.c b/swaynag/types.c
index 7bef0f87..a46aacd5 100644
--- a/swaynag/types.c
+++ b/swaynag/types.c
@@ -33,6 +33,8 @@ struct swaynag_type *swaynag_type_new(const char *name) {
void swaynag_types_add_default(list_t *types) {
struct swaynag_type *type_defaults = swaynag_type_new("<defaults>");
type_defaults->font = strdup("pango:Monospace 10");
+ type_defaults->font_description =
+ pango_font_description_from_string(type_defaults->font);
type_defaults->anchors = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP
| ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT
| ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
@@ -94,6 +96,10 @@ void swaynag_type_merge(struct swaynag_type *dest, struct swaynag_type *src) {
dest->font = strdup(src->font);
}
+ if (src->font_description) {
+ dest->font_description = pango_font_description_copy(src->font_description);
+ }
+
if (src->output) {
dest->output = strdup(src->output);
}
@@ -173,6 +179,7 @@ void swaynag_type_merge(struct swaynag_type *dest, struct swaynag_type *src) {
void swaynag_type_free(struct swaynag_type *type) {
free(type->name);
free(type->font);
+ pango_font_description_free(type->font_description);
free(type->output);
free(type);
}