Bug 423324

Summary: [Wayland-related bug?] Sub menus occasionally broken under GNOME 3, may pop up anywhere on screen
Product: [Frameworks and Libraries] frameworks-kxmlgui Reporter: Ellie <el>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: bugseforuns, christoph, justin.zobel, waqar.17a
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: brokenmenus.png: the broken submenus (backgrounds blurred out for privacy)

Description Ellie 2020-06-21 15:12:22 UTC
Created attachment 129565 [details]
brokenmenus.png: the broken submenus (backgrounds blurred out for privacy)

SUMMARY
kate's menus are occasionally broken under GNOME 3, may pop up anywhere on screen. This happens both with Fedora's natively packaged kate 19.12.2, as well as FlatHub's kate 20.04.2.

STEPS TO REPRODUCE
1. Install GNOME 3 as packaged on Fedora 32 right now
2. Start a GNOME 3 Wayland session (not sure if it reproduces with the Xorg one, probably not)
3. Install & start kate from either flathub or repositories
4. Keep opening sub menus until issue appears, it happens around every 30% of the time

OBSERVED RESULT
See brokenmenus.png: the broken submenus in a screenshot showing the problem. (backgrounds blurred out for privacy) Also, the following shows up in the terminal output:
qt.qpa.wayland: setGrabPopup called with a parent, QtWaylandClient::QWaylandXdgSurface(0x55761166f0c0) which does not match the current topmost grabbing popup, QtWaylandClient::QWaylandXdgSurface(0x5576120f2d40) According to the xdg-shell protocol, this is not allowed. The wayland QPA plugin is currently handling it by setting the parent to the topmost grabbing popup. Note, however, that this may cause positioning errors and popups closing unxpectedly because xdg-shell mandate that child popups close before parents


EXPECTED RESULT
works / no menus placed kinda randomly on the screen

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Fedora 32 with GNOME 3.36.3
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: various, see flatpak/flathub release for one of them

ADDITIONAL INFORMATION
Comment 1 Ellie 2020-06-21 15:15:11 UTC
I forgot to mention, submenus of such broken submenus will also no longer open up when this bug happens. As a consequence it's more than just an annoyance, it actually makes some of the deeper menus really hard to access since this seems to happen 30% of the time a submenu opens, and therefore it has a high likelihood of happening at least once descending into a deeper nesting chain.
Comment 2 Patrick Silva 2020-10-16 21:13:00 UTC
I can reproduce with Kate 20.08.2 running natively on Wayland on Arch Linux + Gnome 3.38.1. Possibly a Qt bug.
Comment 3 Justin Zobel 2020-10-27 23:43:54 UTC
Confirmed by Patrick.
Comment 4 Christoph Cullmann 2025-06-19 15:42:44 UTC
One variant of that is now fixed with

https://invent.kde.org/frameworks/kxmlgui/-/merge_requests/284

For more I think we need a Qt fix 

https://bugreports.qt.io/browse/QTBUG-137467

This is now fixed in Qt and will release with 6.9.2 and 6.10.