aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-03 18:31:09 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-03 18:31:09 +0000
commitef3c7d7e0a329e664e36381327f5f0c51429287d (patch)
treef25cd12e0731963e5a2c2a11928dd2d4e17abf15
parentterm: no need to call render_refresh() when starting/stopping blink timer (diff)
term: init: don't resize if compositor has already resized us
-rw-r--r--terminal.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/terminal.c b/terminal.c
index 15da6bc3..6d2f7a04 100644
--- a/terminal.c
+++ b/terminal.c
@@ -665,21 +665,24 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
term_set_window_title(term, "foot");
- /* Try to use user-configured window dimentions */
- unsigned width = conf->width;
- unsigned height = conf->height;
+ if (term->width == 0 && term->height == 0) {
- if (width == -1) {
- /* No user-configuration - use 80x24 cells */
- assert(height == -1);
- width = 80 * term->cell_width;
- height = 24 * term->cell_height;
- }
+ /* Try to use user-configured window dimentions */
+ unsigned width = conf->width;
+ unsigned height = conf->height;
+
+ if (width == -1) {
+ /* No user-configuration - use 80x24 cells */
+ assert(height == -1);
+ width = 80 * term->cell_width;
+ height = 24 * term->cell_height;
+ }
- /* Don't go below a single cell */
- width = max(width, term->cell_width);
- height = max(height, term->cell_height);
- render_resize(term, width, height);
+ /* Don't go below a single cell */
+ width = max(width, term->cell_width);
+ height = max(height, term->cell_height);
+ render_resize(term, width, height);
+ }
return term;