Skip to content

Commit

Permalink
Application: withdraw stale notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Nov 29, 2024
1 parent 3c15ecc commit 847b63d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,23 @@ public class Terminal.Application : Gtk.Application {
notification.set_icon (process_icon);
notification.set_default_action_and_target_value ("app.process-finished", new Variant.string (id));
send_notification ("process-finished-%s".printf (id), notification);

terminal.main_window.notify["current-terminal"].connect (() => {
if (terminal.main_window.current_terminal == terminal) {
terminal.tab.icon = null;
withdraw_notification ("process-finished-%s".printf (id));
}
});

terminal.main_window.focus_in_event.connect (() => {
if (terminal.main_window.current_terminal == terminal) {
terminal.tab.icon = null;
withdraw_notification ("process-finished-%s".printf (id));
}

return Gdk.EVENT_PROPAGATE;
});

}
});

Expand Down

0 comments on commit 847b63d

Please sign in to comment.