mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
Merge branch 'locked-title'
This commit is contained in:
commit
6f1f1f5614
7 changed files with 22 additions and 0 deletions
|
|
@ -30,6 +30,11 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
* `locked-title=no|yes` to `foot.ini`
|
||||||
|
(https://codeberg.org/dnkl/foot/issues/386).
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* Non-empty lines are now considered to have a hard linebreak,
|
* Non-empty lines are now considered to have a hard linebreak,
|
||||||
|
|
|
||||||
3
config.c
3
config.c
|
|
@ -643,6 +643,9 @@ parse_section_main(const char *key, const char *value, struct config *conf,
|
||||||
conf->title = xstrdup(value);
|
conf->title = xstrdup(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (strcmp(key, "locked-title") == 0)
|
||||||
|
conf->locked_title = str_to_bool(value);
|
||||||
|
|
||||||
else if (strcmp(key, "app-id") == 0) {
|
else if (strcmp(key, "app-id") == 0) {
|
||||||
free(conf->app_id);
|
free(conf->app_id);
|
||||||
conf->app_id = xstrdup(value);
|
conf->app_id = xstrdup(value);
|
||||||
|
|
|
||||||
1
config.h
1
config.h
|
|
@ -77,6 +77,7 @@ struct config {
|
||||||
wchar_t *word_delimiters;
|
wchar_t *word_delimiters;
|
||||||
bool login_shell;
|
bool login_shell;
|
||||||
bool no_wait;
|
bool no_wait;
|
||||||
|
bool locked_title;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
enum conf_size_type type;
|
enum conf_size_type type;
|
||||||
|
|
|
||||||
|
|
@ -224,6 +224,10 @@ in this order:
|
||||||
*title*
|
*title*
|
||||||
Initial window title. Default: _foot_.
|
Initial window title. Default: _foot_.
|
||||||
|
|
||||||
|
*locked-title*
|
||||||
|
Boolean. If enabled, applications are not allowed to change the
|
||||||
|
title at run-time. Default: _no_.
|
||||||
|
|
||||||
*app-id*
|
*app-id*
|
||||||
Value to set the *app-id* property on the Wayland window to. The
|
Value to set the *app-id* property on the Wayland window to. The
|
||||||
compositor can use this value to e.g. group multiple windows, or
|
compositor can use this value to e.g. group multiple windows, or
|
||||||
|
|
|
||||||
4
foot.ini
4
foot.ini
|
|
@ -4,6 +4,10 @@
|
||||||
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
|
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
|
||||||
# login-shell=no
|
# login-shell=no
|
||||||
|
|
||||||
|
# app-id=foot
|
||||||
|
# title=foot
|
||||||
|
# locked-title=no
|
||||||
|
|
||||||
# font=monospace:size=8
|
# font=monospace:size=8
|
||||||
# font-bold=<bold variant of regular font>
|
# font-bold=<bold variant of regular font>
|
||||||
# font-italic=<italic variant of regular font>
|
# font-italic=<italic variant of regular font>
|
||||||
|
|
|
||||||
|
|
@ -2634,9 +2634,13 @@ term_xcursor_update(struct terminal *term)
|
||||||
void
|
void
|
||||||
term_set_window_title(struct terminal *term, const char *title)
|
term_set_window_title(struct terminal *term, const char *title)
|
||||||
{
|
{
|
||||||
|
if (term->conf->locked_title && term->window_title_has_been_set)
|
||||||
|
return;
|
||||||
|
|
||||||
free(term->window_title);
|
free(term->window_title);
|
||||||
term->window_title = xstrdup(title);
|
term->window_title = xstrdup(title);
|
||||||
render_refresh_title(term);
|
render_refresh_title(term);
|
||||||
|
term->window_title_has_been_set = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -382,6 +382,7 @@ struct terminal {
|
||||||
bool sixel_cursor_right_of_graphics:1;
|
bool sixel_cursor_right_of_graphics:1;
|
||||||
} xtsave;
|
} xtsave;
|
||||||
|
|
||||||
|
bool window_title_has_been_set;
|
||||||
char *window_title;
|
char *window_title;
|
||||||
tll(char *) window_title_stack;
|
tll(char *) window_title_stack;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue