Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9
-
None
Description
If you plug an QAction with a set menu into different menus, you will get:
qt.qpa.wayland: Creating a popup with a parent, QWidgetWindow(0x55613181efd0, name="QMainWindowClassWindow") which does not match the current topmost grabbing popup, QWidgetWindow(0x5561325ddca0, name="QMenuClassWindow") With some shell surface protocols, 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. Please fix the transient parent of the popup.
Simple test application to trigger that below, to get the message, trigger both actions in the two top level menus alternating.
/* * SPDX-FileCopyrightText: 2025 Christoph Cullmann <cullmann@kde.org> * * SPDX-License-Identifier: MIT */ #include <QApplication> #include <QMainWindow> #include <QMenu> #include <QMenuBar> #include <QAction> int main(int argc, char *argv[]) { QApplication app(argc, argv); QMainWindow test; auto m = new QMenuBar(&test); test.setMenuBar(m); auto s = m->addMenu(QStringLiteral("testm")); auto s2 = m->addMenu(QStringLiteral("testm2")); QAction *a = new QAction(QStringLiteral("test"), &test); s->addAction(a); s2->addAction(a); a->setMenu(new QMenu()); a->menu()->addAction(QStringLiteral("test")); test.show(); return app.exec(); }
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-137467 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
651593,2 | QMenu: Fix transient parent for nomadic menus | dev | qt/qtbase | Status: NEW | 0 | 0 |