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, 24 Mar 2023 19:57:17 +0000 (15:57 -0400)
commitfb3fe7a353fa4ed3043e20bb7fbf4c8d09aeba44
tree8f1d4c6ff58ccea627715c3c062c088823a2c806
parentc51387d62b3852af05e65fa0ce6d2221c61e540e
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