From 7f7ac93d4ede7a6a737a9b164af7488499928c97 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 23 Feb 2011 21:56:00 +0100 Subject: [PATCH 1/4] Stops various activities disabling Broadcast All setting (poopup, new tab, new window etc) --- terminatorlib/terminator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 357e31ac..093d9b24 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -50,7 +50,7 @@ class Terminator(Borg): self.terminals = [] if not self.groups: self.groups = [] - if not self.groupsend: + if self.groupsend == None: self.groupsend = self.groupsend_type['group'] if not self.config: self.config = Config() From 9e13bb6aae610a3b064acf37e9bd56d8b76642ec Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 23 Feb 2011 21:59:12 +0100 Subject: [PATCH 2/4] Only perform emits if active window. Closes LP #690947 --- terminatorlib/terminal.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 3d5869c2..8514ac73 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -747,7 +747,9 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) # maybe we can emit the key event and let Terminator() care? groupsend = self.terminator.groupsend groupsend_type = self.terminator.groupsend_type - if groupsend != groupsend_type['off'] and self.vte.is_focus(): + if groupsend != groupsend_type['off'] \ + and self.vte.is_focus() \ + and self.get_toplevel().is_active(): if self.group and groupsend == groupsend_type['group']: self.terminator.group_emit(self, self.group, 'key-press-event', event) From 966c6ca1040291a167345f0dbc3df768e12c41d0 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 23 Feb 2011 22:02:09 +0100 Subject: [PATCH 3/4] Makes the Insert terminal number order more sane in complex layouts --- terminatorlib/terminator.py | 7 ++++++- terminatorlib/util.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 093d9b24..d16ab4b9 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -322,8 +322,13 @@ class Terminator(Borg): else: numstr = '%d' + terminals = [] + for window in self.windows: + containers, win_terminals = enumerate_descendants(window) + terminals.extend(win_terminals) + for term in self.get_target_terms(widget): - idx = self.terminals.index(term) + idx = terminals.index(term) term.feed(numstr % (idx + 1)) def get_target_terms(self, widget): diff --git a/terminatorlib/util.py b/terminatorlib/util.py index 872b76d0..57605cd6 100755 --- a/terminatorlib/util.py +++ b/terminatorlib/util.py @@ -268,7 +268,7 @@ def enumerate_descendants(parent): terminals.append(descendant) while len(containerstmp) > 0: - child = containerstmp.pop() + child = containerstmp.pop(0) for descendant in child.get_children(): if maker.isinstance(descendant, 'Container'): containerstmp.append(descendant) From dc8e6f145168cbe541e2d5ab72ef32e2d1b08b60 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 23 Feb 2011 22:05:41 +0100 Subject: [PATCH 4/4] Makes the Insert terminal number order more sane in complex layouts, missing import of function --- terminatorlib/terminator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index d16ab4b9..600bc8d2 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -10,7 +10,7 @@ import gtk from borg import Borg from config import Config from keybindings import Keybindings -from util import dbg, err +from util import dbg, err, enumerate_descendants from factory import Factory from cwd import get_pid_cwd from version import APP_NAME, APP_VERSION