make focus always switch to the most relevant terminal

This commit is contained in:
Chris Jones 2009-11-14 23:04:15 +00:00
parent bf77106529
commit 22dccb6728
2 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -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()"""