mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-09 05:33:58 -04:00
config: add 'startup-mode' option
This option controls the initial window mode: windowed, maximized or fullscreen. The default is windowed.
This commit is contained in:
parent
be8b6e8c75
commit
e197368c0f
6 changed files with 39 additions and 1 deletions
14
terminal.c
14
terminal.c
|
|
@ -13,6 +13,7 @@
|
|||
#include <sys/timerfd.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/input-event-codes.h>
|
||||
#include <xdg-shell.h>
|
||||
|
||||
#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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue