From 76ef3a4ab8c08f9ca5986ee7cc9caf2706e3b923 Mon Sep 17 00:00:00 2001 From: Adrien Schildknecht Date: Fri, 25 Jan 2013 18:32:43 +0100 Subject: [PATCH] remove the urgency indicator when a window is closed --- src/tree.c | 7 +++++++ testcases/t/113-urgent.t | 21 ++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/tree.c b/src/tree.c index c398ee1d..2973c4b8 100644 --- a/src/tree.c +++ b/src/tree.c @@ -200,6 +200,13 @@ bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool was_mapped = _is_con_mapped(con); } + /* remove the urgency hint of the workspace (if set) */ + if (con->urgent) { + con->urgent = false; + con_update_parents_urgency(con); + workspace_update_urgent_flag(con_get_workspace(con)); + } + /* Get the container which is next focused */ Con *next = con_next_focused(con); DLOG("next = %p, focused = %p\n", next, focused); diff --git a/testcases/t/113-urgent.t b/testcases/t/113-urgent.t index ff44e0ea..8c8b74ab 100644 --- a/testcases/t/113-urgent.t +++ b/testcases/t/113-urgent.t @@ -231,6 +231,25 @@ cmd "workspace $tmp"; does_i3_live; -exit_gracefully($pid); +############################################################################### +# Check if the urgency hint is still set when the urgent window is killed +############################################################################### +my $ws1 = fresh_workspace; +my $ws2 = fresh_workspace; +cmd "workspace $ws1"; +my $w1 = open_window; +my $w2 = open_window; +cmd "workspace $ws2"; +sync_with_i3; +$w1->add_hint('urgency'); +sync_with_i3; +cmd '[id="' . $w1->id . '"] kill'; +sync_with_i3; +my $w = get_ws($ws1); +is($w->{urgent}, 0, 'Urgent flag no longer set after killing the window ' . + 'from another workspace'); + + +exit_gracefully($pid); done_testing; -- 2.39.5