aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/config.h
diff options
context:
space:
mode:
authorLibravatar Hugo Osvaldo Barrera <hugo@barrera.io>2022-06-29 21:38:24 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2022-07-01 13:05:58 +0200
commit75605491a54f8647740fdba75dd2ad7bae9e0ca7 (patch)
treef1d7476fbc893517ea01ed0f92841219f8b4808a /include/sway/config.h
parentAvoid unecessary string copy (diff)
downloadsway-75605491a54f8647740fdba75dd2ad7bae9e0ca7.tar.gz
sway-75605491a54f8647740fdba75dd2ad7bae9e0ca7.tar.zst
sway-75605491a54f8647740fdba75dd2ad7bae9e0ca7.zip
Reject font values that are invalid for pango
Use pango to parse font configuration early, and reject the command as invalid if the value is invalid for pango. Since we're already parsing the font into a `PangoFontDescription`, keep that instance around and avoid re-parsing the font each time we render text. Fixes: https://github.com/swaywm/sway/issues/6805
Diffstat (limited to 'include/sway/config.h')
-rw-r--r--include/sway/config.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 05678c33..8939af00 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -17,6 +17,7 @@
17#include "sway/input/tablet.h" 17#include "sway/input/tablet.h"
18#include "sway/tree/root.h" 18#include "sway/tree/root.h"
19#include "wlr-layer-shell-unstable-v1-protocol.h" 19#include "wlr-layer-shell-unstable-v1-protocol.h"
20#include <pango/pangocairo.h>
20 21
21// TODO: Refactor this shit 22// TODO: Refactor this shit
22 23
@@ -504,7 +505,8 @@ struct sway_config {
504 char *floating_scroll_right_cmd; 505 char *floating_scroll_right_cmd;
505 enum sway_container_layout default_orientation; 506 enum sway_container_layout default_orientation;
506 enum sway_container_layout default_layout; 507 enum sway_container_layout default_layout;
507 char *font; 508 char *font; // Use mostly for IPC.
509 PangoFontDescription *font_description; // Used internally for rendering and validating.
508 int font_height; 510 int font_height;
509 int font_baseline; 511 int font_baseline;
510 bool pango_markup; 512 bool pango_markup;