5.15.6, 6.1.2, 6.3.0
Qt currently relies on absolute screen coordinates to place popups - but this cannot work in Wayland. As a result, Qt ends up misplacing menus and other popups.
I have two screens with the following geometries:
I open any Qt application and click e.g. a "File" menu. What happens next is:
- Qt calculates the popup coordinates relative to the window - let's say, (10, 10).
- It attempts to convert the point into screen coordinates - but since it has no information about the parent window coordinates, it still ends up with (10, 10).
- It checks if (10, 10) is within any of the screens - and it's not.
- The popup gets shifted to (1920, 10) to be "visible".
- At best, the popup shows up to the right of where it should've been. At worst, it's not visible at all because the parent window is less than 1920px wide.
Here's an example of code that is moving the popup: https://github.com/qt/qtbase/blob/dev/src/widgets/widgets/qmenu.cpp#L2416
Disabling "if (adjustToDesktop)" fixes that particular bug - but there are many more such cases in the Qt codebase.
From what I understand, using "xdg_positioner" is the solution on Wayland.
QTBUG-85297 Menu location is offset depending on xdg_output.logical_layout in sway