mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Show the application from left click on systray
This commit is contained in:
parent
7bca18f6b3
commit
b6284ea1e6
1 changed files with 9 additions and 1 deletions
|
|
@ -1003,9 +1003,17 @@ void App::setSysTrayIcon() {
|
|||
menu->addSeparator();
|
||||
}
|
||||
menu->addAction(quitAction);
|
||||
if (!mSystemTrayIcon)
|
||||
if (!mSystemTrayIcon) {
|
||||
systemTrayIcon->setContextMenu(menu); // This is a Qt bug. We cannot call setContextMenu more than once. So we
|
||||
// have to keep an instance of the menu.
|
||||
connect(systemTrayIcon, &QSystemTrayIcon::activated, this, [this](QSystemTrayIcon::ActivationReason reason) {
|
||||
// Left-Click and Double Left-Click
|
||||
if (reason == QSystemTrayIcon::Trigger || reason == QSystemTrayIcon::DoubleClick) {
|
||||
auto mainWindow = getMainWindow();
|
||||
if (mainWindow) mainWindow->show();
|
||||
}
|
||||
});
|
||||
}
|
||||
systemTrayIcon->setIcon(QIcon(Constants::WindowIconPath));
|
||||
systemTrayIcon->setToolTip(APPLICATION_NAME);
|
||||
systemTrayIcon->show();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue