Just use QMenu::popup() to show TrayMenu

* So it doesn't rely on the available geometry anymore
* Only tested under Openbox/Tint2 so far
This commit is contained in:
Martchus 2016-12-12 23:59:40 +01:00
parent 3794a9174a
commit 985c99922e
1 changed files with 2 additions and 5 deletions

View File

@ -11,6 +11,7 @@
#include <QSvgRenderer>
#include <QPainter>
#include <QPixmap>
#include <QCursor>
using namespace std;
using namespace Dialogs;
@ -91,11 +92,7 @@ void TrayIcon::handleActivated(QSystemTrayIcon::ActivationReason reason)
break;
case QSystemTrayIcon::Trigger:
m_trayMenu.resize(m_trayMenu.sizeHint());
// when showing the menu manually
// move the menu to the closest of the currently available screen
// this implies that the tray icon is located near the edge of the screen; otherwise this behavior makes no sense
cornerWidget(&m_trayMenu);
m_trayMenu.show();
m_trayMenu.popup(QCursor::pos());
break;
default:
;