https://bugs.kde.org/show_bug.cgi?id=516259
Bug ID: 516259
Summary: dbusmenu items containing multiple lines do not render
correctly, only have single line height and improper
width
Classification: Plasma
Product: Breeze
Version First 6.6.0
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
SUMMARY
A DBusMenu may specify multi-line labels, containing `\n`.
In Plasma/Breeze/Qt these render multiple lines of text, but the menu row
bounding box has two errors:
It is always a single line in height.
The width is computed from the character length of the string, not accounting
for multi-line text layout.
STEPS TO REPRODUCE
```
#include <QApplication>
#include <QPushButton>
#include <QMenu>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QPushButton btn("Click to show menu");
btn.show();
QObject::connect(&btn, &QPushButton::clicked, &btn, [&] {
QMenu m(&btn);
m.addAction("Single line");
m.addAction("Line one\nLine two\nLine three");
m.addAction("After multiline");
m.exec(btn.mapToGlobal(btn.rect().center()));
});
return app.exec();
}
```
`g++ -fPIC $(pkg-config --cflags Qt6Widgets) -o app app.cc $(pkg-config --libs
Qt6Widgets) && ./app`
OBSERVED RESULT
Middle row menu only visible text is "Line two"
EXPECTED RESULT
Middle row menu item should visibly contain "Line one\nLine two\nLine three".
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux cachy 6.19.2-2-cachyos #1 SMP PREEMPT_DYNAMIC Mon, 16
Feb 2026 20:41:55 +0000 x86_64 GNU/Linux
KDE Plasma Version: 6.6.0
KDE Frameworks Version:
Qt Version: 6.10.2-1.1
ADDITIONAL INFORMATION
The provided repro is ~the shortest I could provide. A real implementation
where the bug was identified is in a dbus menu client here:
https://github.com/tailscale/tailscale/issues/18634
I traced this through:
statusnotifieritemsource.cpp, plasma's dbusmenuimporter
dbusmenuimporter createMenu -> QMenu & QAction
Down in QMenuPRivate::updateActionRects() the width is computed with a single
line layout, and the height is computed from font metrics (aka glyph bounding
box height).
--
You are receiving this mail because:
You are watching all bug changes.