Popup with a placement target pops up in a wrong position with compositor in adorner layer
Describe the bug Popups are displayed in a wrong position, with compositor enabled, with Placement Target specified (pointer position works) when the parent control is an adorner layer.
To Reproduce Open a popup (i.e. combobox), which belongs to a control that is placed on an adorner layer, with a placement target, with the compositor enabled.
or
- Clone https://github.com/BAndysc/Avalonia_Compositor_Adorner_Popup_Bug
- Run (by default the compositor is disabled)
- See the correct result: (both popups displayed below the controls)

- Change
UseCompositortotrueand run - See the popup is displayed in a wrong place

Desktop:
- OS: macOS
- Version 11.0.999-cibuild0028025-beta
Additional context: The example might be a bit cursed, but I think it is a common practice to place a combobox in an adorner layer, and the list will be opened in a wrong place as well (as this uses the same popups underneath)
I've checked this again in latest stable Avalonia 11.0.0, but sadly it is still bugged. Sorry for the ping, but let me ping @kekekeks as I believe if anybody might have an idea where the problem is, that's Nikita.
I've debugged the code and I was able to find the offending line:
in Avalonia 0.10 the bounds here were taken directly from TransformedBounds property:
https://github.com/AvaloniaUI/Avalonia/blob/7739bd9ca3a20a8cb2b10c4ee2ca31337b227f4e/src/Avalonia.Controls/Primitives/AdornerLayer.cs#L183-L187
since this property has been removed, new Adorner code constructs TransformedBounds manually, but as you can see the transform Matrix is always set to Identity, which is the problem.
https://github.com/AvaloniaUI/Avalonia/blob/2ecfbb978337ef7937821717c01421cdf60cd504/src/Avalonia.Controls/Primitives/AdornerLayer.cs#L321-L325
Later in the code, this invalid TransformedBounds is assigned to RenderTransform, which is used to determine the popup location:
https://github.com/AvaloniaUI/Avalonia/blob/2ecfbb978337ef7937821717c01421cdf60cd504/src/Avalonia.Controls/Primitives/AdornerLayer.cs#L228
Partial fix:
changing
info.Bounds = new TransformedBounds(new Rect(adorned.Bounds.Size), new Rect(adorned.Bounds.Size), Matrix.Identity);
to
info.Bounds = adorned.GetTransformedBounds();
fixes the problem, but as you can probably guess at this point, this is not the only problem here. With the compositor change, observing for TransformedBounds changes was changed to observing for Bounds changes. This means if the control moves "indirectly" (i.e. its parents move), then this event will not be fired and the Bounds will not be correctly updated.
Since I am not sure how to solve this issue correctly, let me ping @kekekeks since you are the main compositor engine author.