From 3e92361534cdd02e8da8a5f7e8112361b1d6eb67 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 9 May 2021 12:13:14 +0200 Subject: xdg-activation: initial support for setting urgency using XDG activation --- terminal.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index f3513a08..a9712789 100644 --- a/terminal.c +++ b/terminal.c @@ -2632,16 +2632,24 @@ term_bell(struct terminal *term) if (!term->kbd_focus) { if (term->conf->bell.urgent) { - /* There's no 'urgency' hint in Wayland - we just paint the - * margins red */ - term->render.urgency = true; - term_damage_margins(term); + if (!wayl_win_set_urgent(term->window)) { + /* + * Urgency (xdg-activation) is relatively new in + * Wayland. Fallback to our old, “faked”, urgency - + * rendering our window margins in red + */ + term->render.urgency = true; + term_damage_margins(term); + } } + if (term->conf->bell.notify) notify_notify(term, "Bell", "Bell in terminal"); } - if ((term->conf->bell.command.argv != NULL) && (!term->kbd_focus || term->conf->bell.command_focused)) { + if ((term->conf->bell.command.argv != NULL) && + (!term->kbd_focus || term->conf->bell.command_focused)) + { int devnull = open("/dev/null", O_RDONLY); spawn(term->reaper, NULL, term->conf->bell.command.argv, devnull, -1, -1); -- cgit v1.3