gtk.Widget.has_focus() is too new, look for gtk.HAS_FOCUS in flags() instead
This commit is contained in:
parent
68da0b24b3
commit
4b1b58544e
|
@ -925,7 +925,7 @@ 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"""
|
||||||
if not self.vte.has_focus():
|
if not self.vte.flags()>k.HAS_FOCUS:
|
||||||
self.vte.grab_focus()
|
self.vte.grab_focus()
|
||||||
|
|
||||||
def on_vte_focus(self, _widget):
|
def on_vte_focus(self, _widget):
|
||||||
|
|
|
@ -332,7 +332,7 @@ class Terminator(Borg):
|
||||||
def get_focussed_terminal(self):
|
def get_focussed_terminal(self):
|
||||||
"""iterate over all the terminals to find which, if any, has focus"""
|
"""iterate over all the terminals to find which, if any, has focus"""
|
||||||
for terminal in self.terminals:
|
for terminal in self.terminals:
|
||||||
if terminal.has_focus():
|
if terminal.flags()>k.HAS_FOCUS:
|
||||||
return(terminal)
|
return(terminal)
|
||||||
return(None)
|
return(None)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue