GtkTooltip: prevent tooltips from appearing offscreen in edge cases (fixes #2784)

Merged Campbell Jones requested to merge serebit/gtk:gtk-3-24 into gtk-3-24

This patch adds a single additional condition to the maybe_flip_position function in gdkwindowimpl.c. This condition checks to see if the unflipped position (referred to as "primary") is below the bounds of its containing area. If it is, then the flipped position (referred to as "secondary" ) is used instead, even if it failed the previous conditional check.

This resolves an issue that arises most often with desktop environment panels. For several panels, including (but not limited to) xfce-panel, budgie-panel, and tint2, tooltips for some applets would appear below the bounds of the screen. Issue #2784 tracks this problem.

I've tested this patch locally, and the problem is resolved on budgie-panel.

Edited by Campbell Jones

Merge request reports