Merge pull request #4655 from nextcloud/bugfix/gnome-open-main-dialog

Fix the system tray menu not being correctly replaced in setupContextMenu on GNOME
This commit is contained in:
Claudio Cambra 2022-06-24 19:15:36 +02:00 committed by GitHub
commit 05a4b45ba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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();