]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/113-urgent.t
tests: fix setting the urgency hint
[i3/i3] / testcases / t / 113-urgent.t
index 2eb853de1cd958c4880ac934aee76ba7698b7a9a..bb913819b108526371dbc1430813197e8d7dd80a 100644 (file)
@@ -24,8 +24,11 @@ my $_NET_WM_STATE_TOGGLE = 2;
 sub set_urgency {
     my ($win, $urgent_flag, $type) = @_;
     if ($type == 1) {
+        # Because X11::XCB does not keep track of clearing the urgency hint
+        # when receiving focus, we just delete it in all cases and then re-set
+        # it if appropriate.
+        $win->delete_hint('urgency');
         $win->add_hint('urgency') if ($urgent_flag);
-        $win->delete_hint('urgency') if (!$urgent_flag);
     } elsif ($type == 2) {
         my $msg = pack "CCSLLLLLL",
             X11::XCB::CLIENT_MESSAGE, # response_type