Update parent urgency hint if a child is removed.
Patch status: merged
Patch by oblique
To apply this patch, use:
curl http://cr.i3wm.org/patch/178/raw.patch | git am
b/src/con.c
| 14 |
@@ -1369,6 +1369,8 @@ static void con_on_remove_child(Con *con) {
|
| 15 |
} |
| 16 |
|
| 17 |
con_force_split_parents_redraw(con); |
| 18 |
+ con->urgent = con_has_urgent_child(con); |
| 19 |
+ con_update_parents_urgency(con); |
| 20 |
|
| 21 |
/* TODO: check if this container would swallow any other client and |
| 22 |
* don’t close it automatically. */ |
b/testcases/t/113-urgent.t
| 27 |
@@ -278,6 +278,32 @@ for ($type = 1; $type <= 2; $type++) {
|
| 28 |
is($w->{urgent}, 0, 'Urgent flag no longer set after killing the window ' .
|
| 29 |
'from another workspace'); |
| 30 |
|
| 31 |
+############################################################################## |
| 32 |
+# Check if urgent flag can be unset if we move the window out of the container |
| 33 |
+############################################################################## |
| 34 |
+ my $tmp = fresh_workspace; |
| 35 |
+ cmd 'layout tabbed'; |
| 36 |
+ my $w1 = open_window; |
| 37 |
+ my $w2 = open_window; |
| 38 |
+ sync_with_i3; |
| 39 |
+ cmd '[id="' . $w2->id . '"] focus'; |
| 40 |
+ sync_with_i3; |
| 41 |
+ cmd 'split v'; |
| 42 |
+ cmd 'layout stacked'; |
| 43 |
+ my $w3 = open_window; |
| 44 |
+ sync_with_i3; |
| 45 |
+ cmd '[id="' . $w2->id . '"] focus'; |
| 46 |
+ sync_with_i3; |
| 47 |
+ set_urgency($w3, 1, $type); |
| 48 |
+ sync_with_i3; |
| 49 |
+ cmd 'focus parent'; |
| 50 |
+ sync_with_i3; |
| 51 |
+ cmd 'move right'; |
| 52 |
+ cmd '[id="' . $w3->id . '"] focus'; |
| 53 |
+ sync_with_i3; |
| 54 |
+ my $ws = get_ws($tmp); |
| 55 |
+ ok(!$ws->{urgent}, 'urgent flag not set on workspace');
|
| 56 |
+ |
| 57 |
exit_gracefully($pid); |
| 58 |
} |
| 59 |
|