From 7bb0e06dbc3a6a2abee38862b016e4d1d102b3b0 Mon Sep 17 00:00:00 2001
From: Amin Bandali <amin.bandali@savoirfairelinux.com>
Date: Wed, 2 Jun 2021 11:11:36 -0400
Subject: [PATCH] mainapplication: add "Show Jami" tray icon context menu item

On some desktop environments on GNU/Linux, left-clicking on the tray
icon does not execute the restore action.  In some environments, such
as Ubuntu and some other GNOME-based environments, double-clicking the
icon does that, but that's counter-intuitive and not obvious at all to
the user.  So, we add a 'Show Jami' menu item for the system tray
context menu, similar to how jami-gnome did, so the user can clearly
see it as a possible action.

Change-Id: I1e12ba02190c12cf40d293d61e1f023380fbfcf9
---
 src/mainapplication.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mainapplication.cpp b/src/mainapplication.cpp
index e380da7b6..0727d8180 100644
--- a/src/mainapplication.cpp
+++ b/src/mainapplication.cpp
@@ -489,6 +489,9 @@ MainApplication::initSystray()
     QAction* quitAction = new QAction(quitString, this);
     connect(quitAction, &QAction::triggered, this, &MainApplication::cleanup);
 
+    QAction* restoreAction = new QAction(tr("&Show Jami"), this);
+    connect(restoreAction, &QAction::triggered, this, &MainApplication::restoreApp);
+
     connect(systemTray_.get(),
             &QSystemTrayIcon::activated,
             [this](QSystemTrayIcon::ActivationReason reason) {
@@ -505,6 +508,7 @@ MainApplication::initSystray()
                 }
             });
 
+    systrayMenu->addAction(restoreAction);
     systrayMenu->addAction(quitAction);
     systemTray_->setContextMenu(systrayMenu);
     systemTray_->show();
-- 
GitLab