From 22dccb6728f322a3cf3704bdd982fdae4a186d9b Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 14 Nov 2009 23:04:15 +0000 Subject: [PATCH] make focus always switch to the most relevant terminal --- terminatorlib/paned.py | 2 ++ terminatorlib/window.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index 6d1fa17b..62c52276 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -92,6 +92,8 @@ class Paned(Container): self.connect_child(widget, 'maximise', top_window.terminal_zoom, False) + widget.grab_focus() + elif isinstance(widget, gtk.Paned): try: self.connect_child(widget, 'resize-term', self.resizeterm) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 9627723f..520e1f52 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -166,6 +166,7 @@ class Window(Container, gtk.Window): def add(self, widget): """Add a widget to the window by way of gtk.Window.add()""" + gtk.Window.add(self, widget) if isinstance(widget, Terminal): signals = {'close-term': self.closeterm, 'title-change': self.title.set_title, @@ -176,7 +177,7 @@ class Window(Container, gtk.Window): for signal in signals: self.connect_child(widget, signal, signals[signal]) - gtk.Window.add(self, widget) + widget.grab_focus() def remove(self, widget): """Remove our child widget by way of gtk.Window.remove()"""