mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-28 02:55:05 +00:00
service/tray: fix crash when display is called on a menuless item
This commit is contained in:
1 file changed
+6
@@ -109,6 +109,12 @@ void SystemTrayItem::scroll(qint32 delta, bool horizontal) const {
|
||||
|
||||
void SystemTrayItem::display(QObject* parentWindow, qint32 relativeX, qint32 relativeY) {
|
||||
this->item->refMenu();
|
||||
if (!this->item->menu()) {
|
||||
this->item->unrefMenu();
|
||||
qCritical() << "No menu present for" << this;
|
||||
return;
|
||||
}
|
||||
|
||||
auto* platform = new PlatformMenuEntry(&this->item->menu()->rootItem);
|
||||
|
||||
QObject::connect(&this->item->menu()->rootItem, &DBusMenuItem::layoutUpdated, platform, [=]() {
|
||||
|
||||
Reference in new issue
Block a user