aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-10-09 05:41:39 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-10-09 05:41:39 +0000
commitb10d93b0efe657d25e6615e45d5d6b84f069a06c (patch)
treed5612e8d8fe89006f3c634d64cbd4c8d921ea71a /terminal.c
parentdoc: foot.1: remove ‘--’ from example command line (diff)
parentdoc: foot.ini: bell/urgency: add note about this getting replaced in the future (diff)
Merge branch 'bell-triggers-faked-urgency' into master
Closes #157
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index c05d71d4..077d15f0 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2073,6 +2073,12 @@ term_kbd_focus_in(struct terminal *term)
return;
term->kbd_focus = true;
+
+ if (term->render.urgency) {
+ term->render.urgency = false;
+ term_damage_margins(term);
+ }
+
cursor_refresh(term);
if (term->focus_events)
@@ -2363,6 +2369,17 @@ term_flash(struct terminal *term, unsigned duration_ms)
}
}
+void
+term_bell(struct terminal *term)
+{
+ if (term->kbd_focus || !term->conf->bell_set_urgency)
+ return;
+
+ /* There's no 'urgency' hint in Wayland - we just paint the margins red */
+ term->render.urgency = true;
+ term_damage_margins(term);
+}
+
bool
term_spawn_new(const struct terminal *term)
{