From e197368c0ffc2235da9b6b41a0d16cdb5b0b61bb Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 26 Mar 2020 19:39:12 +0100 Subject: config: add 'startup-mode' option This option controls the initial window mode: windowed, maximized or fullscreen. The default is windowed. --- terminal.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 36f0e42b..41b0ccd9 100644 --- a/terminal.c +++ b/terminal.c @@ -13,6 +13,7 @@ #include #include #include +#include #define LOG_MODULE "terminal" #define LOG_ENABLE_DBG 0 @@ -800,6 +801,19 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl, /* Let the Wayland backend know we exist */ tll_push_back(wayl->terms, term); + switch (conf->startup_mode) { + case STARTUP_WINDOWED: + break; + + case STARTUP_MAXIMIZED: + xdg_toplevel_set_maximized(term->window->xdg_toplevel); + break; + + case STARTUP_FULLSCREEN: + xdg_toplevel_set_fullscreen(term->window->xdg_toplevel, NULL); + break; + } + /* Start the slave/client */ if ((term->slave = slave_spawn(term->ptmx, argc, term->cwd, argv, term_env, conf->shell, login_shell)) == -1) goto err; -- cgit v1.3