Package: terminator
Version: 0.97-4
Severity: minor
Tags: patch
Hi,
After having split the window a few times horizontally and vertically,
switching to a window ABOVE using Alt+Up sometimes chooses a terminal far away
from the obvious (unique) one which is directly above.
To reproduce: open a new terminator window, split vertically (Ctrl+Shift+E)
into A and B, split A and B both horizontally (Ctrl+Shift+O) into A1/A2 and
B1/B2. Make A1 a bit smaller, i.e., reduce its height so that it is smaller
than B1. Go to B2, press Alt+Up. You should obviously end up in B1, but you
end up in A1.
This has bugged me for quite a while, today I wrote a fix which you find
attached. The problem is in the function computing distance of other terminals
to the current one. It has an obvious typo for direction == 'up'. The patch
also fixes the return values for 'right' and 'left' even though they didn't
result in bugs.
Thanks for considering.
Regards,
Martin
-- System Information:
Debian Release: 8.0
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages terminator depends on:
ii gconf2 3.2.6-3
ii python-dbus 1.2.0-2+b3
ii python-gobject 3.14.0-1
ii python-gtk2 2.24.0-4
ii python-vte 1:0.28.2-5
pn python:any <none>
Versions of packages terminator recommends:
ii python-gnome2 2.28.1+dfsg-1.1
ii python-keybinder 0.3.0-3
ii python-notify 0.1.1-4
ii xdg-utils 1.1.0~rc1+git20111210-7.3
terminator suggests no packages.
-- no debconf information
diff --git a/terminatorlib/util.py b/terminatorlib/util.py
index b8ad5ab..d1311ca 100755
--- a/terminatorlib/util.py
+++ b/terminatorlib/util.py
@@ -223,11 +223,11 @@ def get_nav_offset(edge, allocation, direction):
if direction == 'left':
return(edge - (allocation.x + allocation.width))
elif direction == 'right':
- return(edge + allocation.x)
+ return(allocation.x - edge)
elif direction == 'up':
- return(edge - (allocation.y - allocation.height))
+ return(edge - (allocation.y + allocation.height))
elif direction == 'down':
- return(edge + allocation.y)
+ return(allocation.y - edge)
else:
raise ValueError('Unknown direction: %s' % direction)