From 8276a6de77acc355026bf35d1e5b9e1ffc83a743 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 12 Jan 2010 00:58:50 +0000 Subject: [PATCH] Fix silly focus issue when creating groups - terminals were instantly stealing focus and cancelling the group name creation --- terminatorlib/terminal.py | 5 +++-- terminatorlib/titlebar.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 26a21c49..5eb96a47 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -874,8 +874,9 @@ 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']: - term.grab_focus() - return(False) + if self.titlebar.creating_group() == False: + term.grab_focus() + return(False) def hide_titlebar(self): """Hide the titlebar""" diff --git a/terminatorlib/titlebar.py b/terminatorlib/titlebar.py index 569f3d74..e94149b2 100755 --- a/terminatorlib/titlebar.py +++ b/terminatorlib/titlebar.py @@ -126,6 +126,10 @@ 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 create_group(self): """Create a new group""" self.groupentry.show()