aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-05 18:25:31 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-05 22:29:37 +1000
commit5d6d24e71aabc026c99ac736c788fa8103658c42 (patch)
treefe0fd2a72ceeb282a335692ebd53f618c476ab21 /sway/config.c
parentRefactor parse_title_format() (diff)
downloadsway-5d6d24e71aabc026c99ac736c788fa8103658c42.tar.gz
sway-5d6d24e71aabc026c99ac736c788fa8103658c42.tar.zst
sway-5d6d24e71aabc026c99ac736c788fa8103658c42.zip
Move code for re-arranging after font height change into a common place
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c
index 2e5eab2b..a14f4ec6 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -24,6 +24,7 @@
24#include "sway/input/seat.h" 24#include "sway/input/seat.h"
25#include "sway/commands.h" 25#include "sway/commands.h"
26#include "sway/config.h" 26#include "sway/config.h"
27#include "sway/tree/arrange.h"
27#include "sway/tree/layout.h" 28#include "sway/tree/layout.h"
28#include "cairo.h" 29#include "cairo.h"
29#include "pango.h" 30#include "pango.h"
@@ -741,8 +742,14 @@ static void find_font_height_iterator(struct sway_container *container,
741 } 742 }
742} 743}
743 744
744void config_find_font_height(bool recalculate) { 745void config_update_font_height(bool recalculate) {
746 size_t prev_max_height = config->font_height;
745 config->font_height = 0; 747 config->font_height = 0;
748
746 container_for_each_descendant_dfs(&root_container, 749 container_for_each_descendant_dfs(&root_container,
747 find_font_height_iterator, &recalculate); 750 find_font_height_iterator, &recalculate);
751
752 if (config->font_height != prev_max_height) {
753 arrange_root();
754 }
748} 755}