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, self.connect_child(widget, 'maximise', top_window.terminal_zoom,
False) False)
widget.grab_focus()
elif isinstance(widget, gtk.Paned): elif isinstance(widget, gtk.Paned):
try: try:
self.connect_child(widget, 'resize-term', self.resizeterm) self.connect_child(widget, 'resize-term', self.resizeterm)

View File

@ -166,6 +166,7 @@ class Window(Container, gtk.Window):
def add(self, widget): def add(self, widget):
"""Add a widget to the window by way of gtk.Window.add()""" """Add a widget to the window by way of gtk.Window.add()"""
gtk.Window.add(self, widget)
if isinstance(widget, Terminal): if isinstance(widget, Terminal):
signals = {'close-term': self.closeterm, signals = {'close-term': self.closeterm,
'title-change': self.title.set_title, 'title-change': self.title.set_title,
@ -176,7 +177,7 @@ class Window(Container, gtk.Window):
for signal in signals: for signal in signals:
self.connect_child(widget, signal, signals[signal]) self.connect_child(widget, signal, signals[signal])
gtk.Window.add(self, widget) widget.grab_focus()
def remove(self, widget): def remove(self, widget):
"""Remove our child widget by way of gtk.Window.remove()""" """Remove our child widget by way of gtk.Window.remove()"""