aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/reload.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-10-21 22:57:29 -0400
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2018-10-21 22:57:29 -0400
commit80e8be71a34c44dec693c0b54f8b6b220920b290 (patch)
tree8696d1c2d30824b01e775c7f118a58eb92ec3ebb /sway/commands/reload.c
parentMerge pull request #2913 from emersion/fix-swaybar-hotplug (diff)
downloadsway-80e8be71a34c44dec693c0b54f8b6b220920b290.tar.gz
sway-80e8be71a34c44dec693c0b54f8b6b220920b290.tar.zst
sway-80e8be71a34c44dec693c0b54f8b6b220920b290.zip
cmd_reload: recalc font sizing + rebuild textures
When the config gets reloaded, the font height and baseline get reset to 0. If the config does not have a font command in it, the variables will remain at 0 causing a transparent area where the title would be rendered. This makes it so the font height and baseline are recalculated. Additionally, since the font height and baseline may have changed due to the reload, the title and marks textures are rebuilt.
Diffstat (limited to 'sway/commands/reload.c')
-rw-r--r--sway/commands/reload.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sway/commands/reload.c b/sway/commands/reload.c
index 9e136d48..791081a8 100644
--- a/sway/commands/reload.c
+++ b/sway/commands/reload.c
@@ -5,9 +5,17 @@
5#include "sway/ipc-server.h" 5#include "sway/ipc-server.h"
6#include "sway/server.h" 6#include "sway/server.h"
7#include "sway/tree/arrange.h" 7#include "sway/tree/arrange.h"
8#include "sway/tree/view.h"
8#include "list.h" 9#include "list.h"
9#include "log.h" 10#include "log.h"
10 11
12static void rebuild_textures_iterator(struct sway_container *con, void *data) {
13 if (con->view) {
14 view_update_marks_textures(con->view);
15 }
16 container_update_title_textures(con);
17}
18
11static void do_reload(void *data) { 19static void do_reload(void *data) {
12 // store bar ids to check against new bars for barconfig_update events 20 // store bar ids to check against new bars for barconfig_update events
13 list_t *bar_ids = create_list(); 21 list_t *bar_ids = create_list();
@@ -40,6 +48,9 @@ static void do_reload(void *data) {
40 list_foreach(bar_ids, free); 48 list_foreach(bar_ids, free);
41 list_free(bar_ids); 49 list_free(bar_ids);
42 50
51 config_update_font_height(true);
52 root_for_each_container(rebuild_textures_iterator, NULL);
53
43 arrange_root(); 54 arrange_root();
44} 55}
45 56