i3 - improved tiling WM


remove the urgency indicator when a window is closed

Patch status: merged

Patch by Adrien Schildknecht

To apply this patch, use:
curl http://cr.i3wm.org/patch/19/raw.patch | git am

b/src/tree.c

14
@@ -200,6 +200,13 @@ bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool
15
         was_mapped = _is_con_mapped(con);
16
     }
17
 
18
+    /* remove the urgency hint of the worskpace (if set) */
19
+    if (con->urgent) {
20
+        con->urgent = false;
21
+        con_update_parents_urgency(con);
22
+        workspace_update_urgent_flag(con_get_workspace(con));
23
+    }
24
+
25
     /* Get the container which is next focused */
26
     Con *next = con_next_focused(con);
27
     DLOG("next = %p, focused = %p\n", next, focused);

b/testcases/t/113-urgent.t

32
@@ -231,6 +231,25 @@ cmd "workspace $tmp";
33
 
34
 does_i3_live;
35
 
36
-exit_gracefully($pid);
37
+###############################################################################
38
+# Check if the urgency hint is still set when the urgent window is killed
39
+###############################################################################
40
 
41
+my $ws1 = fresh_workspace;
42
+my $ws2 = fresh_workspace;
43
+cmd "workspace $ws1";
44
+my $w1 = open_window;
45
+my $w2 = open_window;
46
+cmd "workspace $ws2";
47
+sync_with_i3;
48
+$w1->add_hint('urgency');
49
+sync_with_i3;
50
+cmd '[id="' . $w1->id . '"] kill';
51
+sync_with_i3;
52
+my $w = get_ws($ws1);
53
+is($w->{urgent}, 0, 'Urgent flag no longer set after killing the window ' .
54
+    'from another workspace');
55
+
56
+
57
+exit_gracefully($pid);
58
 done_testing;