Comment 18 for bug 328235

Revision history for this message
Juan Manuel Santos (juan-manuel-santos) wrote :

Hello everybody. I've been using Terminator at work for a while now, and this bug is particularly annoying for me.

I have been hacking around at Terminator today trying to fix it. First I tried to attack this bug from the layout flank, trying to position the current terminal in the layout, and guessing from there and the requested direction, which one should be focused. It was actually really hard for me to do, so I decided to fix the current way of doing things (that would be more Pythonic now wouldn't it? ;))

Basically what I did in this patch, was to throw out the old x and y positions based on cursor positions, and get (as Chris said) the center of the terminal, and use those coordinates as calculations. I'm testing it and it seems to work OK, though I haven't tested it in really twisted layouts.

Two things to note:
* There is a "get_focussed_terminal". Just for spelling sake, I believe it should be "get_focused_terminal". I only mark this out because it took me a while to find it, cause I didn't notice that it had two ss' :P.
*That same method in terminator.py seems not to return the current terminal (always return None for me). I printed the flags for all terminals and were all the same. As a workaround I set a local variable in the focus_changed method, to record the widget that is passed as parameter as the current terminal (and modified get_focussed.. so it returned that variable). Just a hint.

Hope the patch is useful, please test.

Cheers
Juan Manuel