From 78fad7189458660521847bc406d7f18ed22f2751 Mon Sep 17 00:00:00 2001 From: oblique Date: Wed, 12 Jun 2013 04:40:37 +0300 Subject: [PATCH] Update parent urgency hint if a child is removed. --- src/con.c | 2 ++ testcases/t/113-urgent.t | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/con.c b/src/con.c index fe26d694..7ef19477 100644 --- a/src/con.c +++ b/src/con.c @@ -1369,6 +1369,8 @@ static void con_on_remove_child(Con *con) { } con_force_split_parents_redraw(con); + con->urgent = con_has_urgent_child(con); + con_update_parents_urgency(con); /* TODO: check if this container would swallow any other client and * don’t close it automatically. */ diff --git a/testcases/t/113-urgent.t b/testcases/t/113-urgent.t index 02f98af5..2eb853de 100644 --- a/testcases/t/113-urgent.t +++ b/testcases/t/113-urgent.t @@ -278,6 +278,32 @@ for ($type = 1; $type <= 2; $type++) { is($w->{urgent}, 0, 'Urgent flag no longer set after killing the window ' . 'from another workspace'); +############################################################################## +# Check if urgent flag can be unset if we move the window out of the container +############################################################################## + my $tmp = fresh_workspace; + cmd 'layout tabbed'; + my $w1 = open_window; + my $w2 = open_window; + sync_with_i3; + cmd '[id="' . $w2->id . '"] focus'; + sync_with_i3; + cmd 'split v'; + cmd 'layout stacked'; + my $w3 = open_window; + sync_with_i3; + cmd '[id="' . $w2->id . '"] focus'; + sync_with_i3; + set_urgency($w3, 1, $type); + sync_with_i3; + cmd 'focus parent'; + sync_with_i3; + cmd 'move right'; + cmd '[id="' . $w3->id . '"] focus'; + sync_with_i3; + my $ws = get_ws($tmp); + ok(!$ws->{urgent}, 'urgent flag not set on workspace'); + exit_gracefully($pid); } -- 2.39.5