popover: Correct placement of popovers
authorMatthias Clasen <mclasen@redhat.com>
Fri, 24 Mar 2023 18:47:27 +0000 (14:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 21 Apr 2023 06:38:12 +0000 (08:38 +0200)
commitbb48a02a77c6c7501898d4e11f57cdab2031bbfb
tree66c2903e0ce088bbcfe6d993ad9e350db7b71f0c
parent4897ff02781acf1ec9964ccbf9945e6956e57e2a
popover: Correct placement of popovers

When we don't have a pointing-to rectangle, we want to place
the popover wrt to the parents bounds. But if we have a
pointing-to rectangle, it is relative to the widgets allocation,
which is different from the bounds.

We were not handling the second case correctly, leading to context
menus in the text view being mispositioned by the widgets CSS padding.

While we are touching this code, rewrite it to handle transforms.

Fixes: #5695
gtk/gtkpopover.c