From: Claudio Cambra Date: Mon, 20 Jun 2022 17:13:11 +0000 (+0200) Subject: Fix the system tray menu not being correctly replaced in setupContextMenu X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~15^2~139^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=749f5dee82e66e784a72554b0d416781eef3476a;p=nextcloud-desktop.git Fix the system tray menu not being correctly replaced in setupContextMenu Signed-off-by: Claudio Cambra --- diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index 7de521ca7..128937cde 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -150,6 +150,9 @@ void Systray::setupContextMenu() } _contextMenu = new QMenu(); + // NOTE: for reasons unclear, setting the the new menu after adding all the actions + // will not work on GNOME, as the old menu will not be correctly replaced. + setContextMenu(_contextMenu); if (AccountManager::instance()->accounts().isEmpty()) { _contextMenu->addAction(tr("Add account"), this, &Systray::openAccountWizard); @@ -162,7 +165,6 @@ void Systray::setupContextMenu() _contextMenu->addAction(tr("Settings"), this, &Systray::openSettings); _contextMenu->addAction(tr("Help"), this, &Systray::openHelp); _contextMenu->addAction(tr("Exit %1").arg(Theme::instance()->appNameGUI()), this, &Systray::shutdown); - setContextMenu(_contextMenu); connect(_contextMenu, &QMenu::aboutToShow, [=] { const auto folders = FolderMan::instance()->map();