From 606ca3707b24a4193b902bd6275ea221b97e2358 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 12 Jan 2010 01:05:53 +0000 Subject: [PATCH] Extend previous commit to cover the titlebar itself, which previously would suffer subtle focus failures --- terminatorlib/editablelabel.py | 6 +++++- terminatorlib/terminal.py | 2 +- terminatorlib/titlebar.py | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/terminatorlib/editablelabel.py b/terminatorlib/editablelabel.py index e0216e07..168f3157 100644 --- a/terminatorlib/editablelabel.py +++ b/terminatorlib/editablelabel.py @@ -54,7 +54,11 @@ class EditableLabel(gtk.EventBox): def set_angle(self, angle ): """set angle of the label""" self._label.set_angle( angle ) - + + def editing(self): + """Return if we are currently editing""" + return(self._entry != None) + def set_text(self, text, force=False): """set the text of the label""" self._autotext = text diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 5eb96a47..ee27ebf1 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -874,7 +874,7 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) def on_vte_notify_enter(self, term, event): """Handle the mouse entering this terminal""" if self.config['focus'] in ['sloppy', 'mouse']: - if self.titlebar.creating_group() == False: + if self.titlebar.editing() == False: term.grab_focus() return(False) diff --git a/terminatorlib/titlebar.py b/terminatorlib/titlebar.py index e94149b2..43f4d3b1 100755 --- a/terminatorlib/titlebar.py +++ b/terminatorlib/titlebar.py @@ -126,9 +126,9 @@ class Titlebar(gtk.EventBox): """Re-emit an edit-done signal from an EditableLabel""" self.emit('edit-done') - def creating_group(self): - """Determine if we're currently creating a group""" - return(self.groupentry.get_property('visible')) + def editing(self): + """Determine if we're currently editing a group name or title""" + return(self.groupentry.get_property('visible') or self.label.editing()) def create_group(self): """Create a new group"""