popup: remake offsets param, add ability to have a offset from the window (close #410)