From a438c4b43b9e8a0621d7b4c2cb8efe58c9349e2e Mon Sep 17 00:00:00 2001 From: Graeme Humphries Date: Thu, 15 Mar 2012 10:08:08 -0700 Subject: [PATCH] Fixed loss of focus bug (github-1). --- crussh.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crussh.py b/crussh.py index 6ee682b..0d5f677 100755 --- a/crussh.py +++ b/crussh.py @@ -72,7 +72,7 @@ def reflowTable(cols=1, rows=1): def reflow(): size = MainWin.allocation cols = int(math.floor((size.width + Table.props.column_spacing) / TermMinWidth)) - if cols < 1: + if cols < 1 or len(args.hosts) == 1: cols = 1 rows = int(math.ceil(len(Terminals)/cols)) if rows < 1: @@ -111,6 +111,8 @@ def feed_input(widget, event): for host in Terminals: t_event = event.copy() Terminals[host].event(t_event) + # this stops regular handler from firing, switching focus. + return True EntryBox.connect("key_press_event", feed_input) EntryBox.connect("key_release_event", feed_input)