problem with "contact info tooltip"
Bug description
When the tooltip does not fit neither "under mouse cursor" nor "above mouse cursor", then it appears under the cursor and immediately closes because the cursor is no longer hovering over the contact ('cause it's hovering over the tooltip now...)
Steps to reproduce
- low vertical screen resolution (768 could do)
- get a contact which provides the "location info", "tune playing", "idle time", "song playing", "mood", etc. ... all at once (thanks to vorner for having such configuration)
- Put that contact in the middle of the screen height (move the rooster window/scroll the rooster)
- Mouseover it Expected: A tooltip displaying somewhere and staying displayed Observed: The tooltip displays for a fraction of a second and immediately disappears again
Attached patch handles such situations by moving the tooltip left/right, so it's edge is 7px to the left/right from the cursor. A tooltip should always fit horizontally, since it has a limited width (appears so, not 100% sure, though.) If someone rotates his screen (so it's higher than wider), things won't break, since it fits above/under the cursor as it always used to
Another solution would be not closing the tooltip until the mouse pointer actually moves. (example: mouse is hovering contact -> tooltip opens -> mouse is hovering tooltip -> tooltip stays, mouse moves -> tooltip hides) IMO the first solution solution is visually better. Having #2 (closed) working as the backup plan for someone, say, running gajim on a low-res smartphone wouldn't hurt.
There appears to uncover another problem, though.
elif not self.check_last_time: self.preferred_position[0] -= half_width That code appears to make the tooltip jump to the left random time AFTER it was displayed. I call it "Horizontal centering jumping". I have seen it on regular tiny tooltips too, big tooltips just make it more visible.