With the previous trivial porting the completion widget ends up in the void.
With the second commit, it at least seems to be positioned reasonable.
But I assume just removing this is a no good idea because one need to catch that cases for good positioning on screen edges.
I still fail a bit to see why the code behaves that differently, will try to debug a bit more in the near future in this branch.