gtk.Widget.has_focus() is too new, look for gtk.HAS_FOCUS in flags() instead

This commit is contained in:
Chris Jones 2010-04-11 00:54:07 +01:00
parent 68da0b24b3
commit 4b1b58544e
2 changed files with 2 additions and 2 deletions

View File

@ -925,7 +925,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
def grab_focus(self):
"""Steal focus for this terminal"""
if not self.vte.has_focus():
if not self.vte.flags()&gtk.HAS_FOCUS:
self.vte.grab_focus()
def on_vte_focus(self, _widget):

View File

@ -332,7 +332,7 @@ class Terminator(Borg):
def get_focussed_terminal(self):
"""iterate over all the terminals to find which, if any, has focus"""
for terminal in self.terminals:
if terminal.has_focus():
if terminal.flags()&gtk.HAS_FOCUS:
return(terminal)
return(None)