From 827396237253d3c784c7455a9f3f2c26a8128c51 Mon Sep 17 00:00:00 2001 From: Raimund Sacherer Date: Sat, 7 Oct 2023 19:37:04 +0200 Subject: Enable the use of flash as visual bell With this patch we can configure flash in the bell section. The colors section allow now to configure the color and translucency of the flash. --- terminal.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index 91c46a11..da64740e 100644 --- a/terminal.c +++ b/terminal.c @@ -1170,6 +1170,8 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper, .colors = { .fg = conf->colors.fg, .bg = conf->colors.bg, + .flash = conf->colors.flash, + .flash_alpha = conf->colors.flash_alpha, .alpha = conf->colors.alpha, .selection_fg = conf->colors.selection_fg, .selection_bg = conf->colors.selection_bg, @@ -1922,7 +1924,9 @@ term_reset(struct terminal *term, bool hard) fdm_del(term->fdm, term->blink.fd); term->blink.fd = -1; term->colors.fg = term->conf->colors.fg; term->colors.bg = term->conf->colors.bg; + term->colors.flash = term->conf->colors.flash; term->colors.alpha = term->conf->colors.alpha; + term->colors.flash_alpha = term->conf->colors.flash_alpha; term->colors.selection_fg = term->conf->colors.selection_fg; term->colors.selection_bg = term->conf->colors.selection_bg; term->colors.use_custom_selection = term->conf->colors.use_custom.selection; @@ -3270,6 +3274,7 @@ term_flash(struct terminal *term, unsigned duration_ms) void term_bell(struct terminal *term) { + if (!term->bell_action_enabled) return; @@ -3288,6 +3293,9 @@ term_bell(struct terminal *term) if (term->conf->bell.notify) notify_notify(term, "Bell", "Bell in terminal"); + if (term->conf->bell.flash) + term_flash(term, 100); + if ((term->conf->bell.command.argv.args != NULL) && (!term->kbd_focus || term->conf->bell.command_focused)) { -- cgit v1.3 From eea995637d2e65c206734a4d8084a9b500f77f05 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 10 Oct 2023 08:09:26 +0200 Subject: term: remove unneeded (and mostly unused) term->flash{,_alpha} --- terminal.c | 4 ---- terminal.h | 2 -- 2 files changed, 6 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index da64740e..9a76488e 100644 --- a/terminal.c +++ b/terminal.c @@ -1170,8 +1170,6 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper, .colors = { .fg = conf->colors.fg, .bg = conf->colors.bg, - .flash = conf->colors.flash, - .flash_alpha = conf->colors.flash_alpha, .alpha = conf->colors.alpha, .selection_fg = conf->colors.selection_fg, .selection_bg = conf->colors.selection_bg, @@ -1924,9 +1922,7 @@ term_reset(struct terminal *term, bool hard) fdm_del(term->fdm, term->blink.fd); term->blink.fd = -1; term->colors.fg = term->conf->colors.fg; term->colors.bg = term->conf->colors.bg; - term->colors.flash = term->conf->colors.flash; term->colors.alpha = term->conf->colors.alpha; - term->colors.flash_alpha = term->conf->colors.flash_alpha; term->colors.selection_fg = term->conf->colors.selection_fg; term->colors.selection_bg = term->conf->colors.selection_bg; term->colors.use_custom_selection = term->conf->colors.use_custom.selection; diff --git a/terminal.h b/terminal.h index 4939b91e..da873ae6 100644 --- a/terminal.h +++ b/terminal.h @@ -508,8 +508,6 @@ struct terminal { struct { uint32_t fg; uint32_t bg; - uint32_t flash; - uint32_t flash_alpha; uint32_t table[256]; uint16_t alpha; uint32_t selection_fg; -- cgit v1.3