mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-23 05:33:57 -04:00
term: init: don't resize if compositor has already resized us
This commit is contained in:
parent
782da0f8e9
commit
ef3c7d7e0a
1 changed files with 16 additions and 13 deletions
29
terminal.c
29
terminal.c
|
|
@ -665,22 +665,25 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
||||||
|
|
||||||
term_set_window_title(term, "foot");
|
term_set_window_title(term, "foot");
|
||||||
|
|
||||||
/* Try to use user-configured window dimentions */
|
if (term->width == 0 && term->height == 0) {
|
||||||
unsigned width = conf->width;
|
|
||||||
unsigned height = conf->height;
|
|
||||||
|
|
||||||
if (width == -1) {
|
/* Try to use user-configured window dimentions */
|
||||||
/* No user-configuration - use 80x24 cells */
|
unsigned width = conf->width;
|
||||||
assert(height == -1);
|
unsigned height = conf->height;
|
||||||
width = 80 * term->cell_width;
|
|
||||||
height = 24 * term->cell_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;
|
return term;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue