Improve navigation between terminal windows

Fix computation of edge distance calculation, so that Alt+Up (and other
Alt+<dir> keys navigate properly).

Patch from Julián Moreno Patiño (junix), apparently flagged in a Debian
bug report?

Fixes: LP #1433810

Tested-by: Bryce Harrington <bryce@bryceharrington.org>
Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
This commit is contained in:
bryce 2015-06-01 18:46:08 -07:00
parent 0cf2b98a0f
commit 7cd84d75a4
1 changed files with 3 additions and 3 deletions

View File

@ -224,11 +224,11 @@ def get_nav_offset(edge, allocation, direction):
if direction == 'left': if direction == 'left':
return(edge - (allocation.x + allocation.width)) return(edge - (allocation.x + allocation.width))
elif direction == 'right': elif direction == 'right':
return(edge + allocation.x) return(allocation.x - edge)
elif direction == 'up': elif direction == 'up':
return(edge - (allocation.y - allocation.height)) return(edge - (allocation.y + allocation.height))
elif direction == 'down': elif direction == 'down':
return(edge + allocation.y) return(allocation.y - edge)
else: else:
raise ValueError('Unknown direction: %s' % direction) raise ValueError('Unknown direction: %s' % direction)