diff --git a/src/pane.vala b/src/pane.vala index e54f5a3..ba28c2b 100644 --- a/src/pane.vala +++ b/src/pane.vala @@ -30,14 +30,14 @@ namespace Footerm { [GtkChild] private unowned Footerm.TerminalPane terminal_pane; - public signal void title_changed (string new_title); + public signal void title_changed (Footerm.Pane pane, string new_title); construct { - this.new_pane.title_changed.connect ((s) => this.title_changed (s)); + this.new_pane.title_changed.connect ((s) => this.title_changed (this, s)); this.new_pane.on_server_selected.connect ((s) => { this.footerm_pane_stack.set_visible_child (this.terminal_pane); - this.title_changed (s.name); - this.terminal_pane.title_changed.connect ((s) => this.title_changed (s)); + this.title_changed (this, s.name); + this.terminal_pane.title_changed.connect ((s) => this.title_changed (this, s)); this.terminal_pane.connect_to_server_async (s); }); } diff --git a/src/window.vala b/src/window.vala index 9b46b4f..f8ab517 100644 --- a/src/window.vala +++ b/src/window.vala @@ -42,9 +42,12 @@ namespace Footerm { var pane = new Footerm.Pane (); var tab_page = this.view.append (pane); tab_page.set_title ("New Pane"); - pane.title_changed.connect ((title) => { - tab_page.set_title (title); - }); + pane.title_changed.connect (on_page_title_changed); + } + + private void on_page_title_changed (Footerm.Pane pane, string title) { + var tab_page = this.view.get_page (pane); + tab_page.set_title (title); } private bool close_page (Adw.TabView tab_view, Adw.TabPage page) {