Commit e92b30be authored by Sergio Costas's avatar Sergio Costas

Now, when closing a terminal in a splitted window, the other terminal will receive the focus

parent 7b0a546b
......@@ -126,6 +126,14 @@ namespace Terminus {
this.terminal = null;
}
public void do_grab_focus() {
if (this.terminal == null) {
this.container1.do_grab_focus();
} else {
this.terminal.do_grab_focus();
}
}
public void ended_child(Terminus.Container child) {
Terminus.Container old_container;
......@@ -144,6 +152,7 @@ namespace Terminus {
if (new_child is Terminus.Terminal) {
this.terminal = new_child as Terminus.Terminal;
this.set_terminal_child();
this.terminal.do_grab_focus();
} else {
this.paned = new_child as Terminus.PanedPercentage;
this.container1 = old_container.container1;
......@@ -152,6 +161,7 @@ namespace Terminus {
this.container2.ended.connect(this.ended_child);
this.add(this.paned);
this.paned.show_all();
this.container1.do_grab_focus();
}
}
}
......
......@@ -59,6 +59,11 @@ namespace Terminus {
}
public void do_grab_focus() {
this.vte_terminal.grab_focus();
}
public Terminal(Terminus.Base main_container, Terminus.Container top_container) {
had_focus = true; // when creating a new terminal, it must take the focus
......@@ -420,7 +425,7 @@ namespace Terminus {
s_title = "/bin/bash";
}
this.top_container.set_tab_title(s_title);
var bgcolor = Gdk.RGBA();
string fg;
string bg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment