Tidy up some focus grabbing on new Terminal creation. Closes LP #558376
This commit is contained in:
parent
71e6acd6e4
commit
68da0b24b3
@ -125,6 +125,7 @@ class Notebook(Container, gtk.Notebook):
|
|||||||
self.set_current_page(page_num)
|
self.set_current_page(page_num)
|
||||||
|
|
||||||
self.show_all()
|
self.show_all()
|
||||||
|
terminal.grab_focus()
|
||||||
|
|
||||||
def add(self, widget):
|
def add(self, widget):
|
||||||
"""Add a widget to the container"""
|
"""Add a widget to the container"""
|
||||||
@ -196,7 +197,9 @@ class Notebook(Container, gtk.Notebook):
|
|||||||
gtk.PACK_START)
|
gtk.PACK_START)
|
||||||
|
|
||||||
self.set_current_page(-1)
|
self.set_current_page(-1)
|
||||||
widget.grab_focus()
|
self.show_all()
|
||||||
|
if maker.isinstance(widget, 'Terminal'):
|
||||||
|
widget.grab_focus()
|
||||||
|
|
||||||
def wrapcloseterm(self, widget):
|
def wrapcloseterm(self, widget):
|
||||||
"""A child terminal has closed"""
|
"""A child terminal has closed"""
|
||||||
|
@ -925,7 +925,8 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
|
|||||||
|
|
||||||
def grab_focus(self):
|
def grab_focus(self):
|
||||||
"""Steal focus for this terminal"""
|
"""Steal focus for this terminal"""
|
||||||
self.vte.grab_focus()
|
if not self.vte.has_focus():
|
||||||
|
self.vte.grab_focus()
|
||||||
|
|
||||||
def on_vte_focus(self, _widget):
|
def on_vte_focus(self, _widget):
|
||||||
"""Update our UI when we get focus"""
|
"""Update our UI when we get focus"""
|
||||||
|
Loading…
Reference in New Issue
Block a user