Created attachment 1623290 [details] Screenshot Description of problem: When using Wayland and a multi-monitor setup, Qt5 does not place popup menus correctly - they're displayed at an offset, or missing completely if the offset would make it appear outside of the parent window. Gtk+ used to have the exact same problem: it would try to calculate the popup position based on the parent window coordinates and screen dimensions - but Wayland does not expose window coordinates. I'm guessing Qt5 is doing the same thing. The bug has probably always been there - but Qt5 didn't use Wayland by default until Fedora 31. Version-Release number of selected component (if applicable): qt5-qtwayland-5.12.5-1.fc31.x86_64 How reproducible: Depends on the window location, but for a given location, happens consistently Steps to Reproduce: 1. Make sure you have multiple monitors side by side 2. Open /usr/lib64/qt5/examples/widgets/richtext/textedit/textedit on the monitor to the right 3. Right-click the text or open File/Edit/etc. menus Actual results: Popup menu is shifted to the right Expected results: Popup menu should work as usual Additional info:
This is unfortunately a known regression in qtwayland, see [1] and fixing this properly requires significant amount of work. This can be workarounded on per-app basis, but it's not probably what we want to do for every application. [1] - https://bugreports.qt.io/browse/QTBUG-68636
This message is a reminder that Fedora 31 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '31'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 31 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
*** Bug 1900838 has been marked as a duplicate of this bug. ***
I decided to look into this myself. Both Qt5 and Qt6 have the same bug that Gtk used to have: they rely on absolute coordinates to place popups in visible areas of the screen. But, obviously, this cannot work in Wayland since there are no more absolute coordinates. What Qt ends up doing is: - Calculate the popup's absolute coordinates - but get window-relative coordinates instead - Compare the (wrong) coordinates to the screen geometry - Determine (incorrectly) that the popup would be displayed outside of any of the screens - Shift the popup to the right by first screen's width, or down by first screen's height Best case: popup appears at the wrong location. Worst case: popup's location is outside of the parent window, so it does not appear at all. There is an example of the code doing these calculations: https://github.com/qt/qtbase/blob/dev/src/widgets/widgets/qmenu.cpp#L2416 Unfortunately, there are many, many references to absolute coordinates and screen geometry throughout Qt codebase. I have not noticed much progress on the upstream bug - and it's unrealistic for me to fix it all myself. Right now, practically all Qt apps are unusable - and it's been like this for two years now. The only solutions I see are: - Switch Qt back to X11 - Patch Qt to disable broken code Would Fedora accept Qt patches that have no chance of getting upsteamed, but would keep Qt apps mostly working? (I know I can switch Qt to X11 myself - but I still find it incredible that things are this broken out of the box.)
You are correct with your observations, but I'm not sure it's safe to disable part of the code which is misbehaving on Wayland, because it might have an impact on someone else. I would like to look into this myself, but I didn't have time yet.
The issue is more extreme when you have at least 2 screens and with different resolution. In my case, I have a laptop with a 14'' UHD screen and an external 22'' FHD monitor. When I use Wayland, on the external monitor, the first 2-3 popup menus are misplaced but only horizontally. If I move the same application to the laptop's screen, the popup menu is completely misplaced, both horizontally (but not that much) and vertically, it's moved almost at the bottom of the screen.
(In reply to Peter Tselios from comment #7) > The issue is more extreme when you have at least 2 screens and with > different resolution. > In my case, I have a laptop with a 14'' UHD screen and an external 22'' FHD > monitor. > When I use Wayland, on the external monitor, the first 2-3 popup menus are > misplaced but only horizontally. > If I move the same application to the laptop's screen, the popup menu is > completely misplaced, both horizontally (but not that much) and vertically, > it's moved almost at the bottom of the screen. I forgot to mention: F34.
This message is a reminder that Fedora Linux 34 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '34'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 34 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
So, there seem to be at least two relevant upstream issues here: https://bugreports.qt.io/browse/QTBUG-68636 (marked fixed in 6 but not 5?) https://bugreports.qt.io/browse/QTBUG-85297 (still open) so it sort of looks like this is still an issue, but can anyone confirm for sure?
Yes, still an issue for me.
OK, let's bump it to 36 then.
FEDORA-2022-d1ac004bb1 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-d1ac004bb1
FEDORA-2022-d1ac004bb1 has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2022-fd5a821d68 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-fd5a821d68
FEDORA-2022-fd5a821d68 has been pushed to the Fedora 36 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-fd5a821d68` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-fd5a821d68 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-fd5a821d68 has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report.