QDBusTrayIcon: add xdg-activation support
[ChangeLog][QtGui][Linux/Wayland] StatusNotifierItem tray implementation supports getting window focus token from desktop environments supporting the ProvideXdgActivationToken extension (e.g. KDE) Change-Id: Idcd79a4224b74d6eedfcf1b90129b1a2d3e14312 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit c81d5ec19a3bb85a4b8197bd3176dc873c3b7a68) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
69b1b91e0d
commit
17f0d47413
@ -136,6 +136,12 @@ void QStatusNotifierItemAdaptor::ContextMenu(int x, int y)
|
||||
emit m_trayIcon->activated(QPlatformSystemTrayIcon::Context);
|
||||
}
|
||||
|
||||
void QStatusNotifierItemAdaptor::ProvideXdgActivationToken(const QString &token)
|
||||
{
|
||||
qCDebug(qLcTray) << token;
|
||||
qputenv("XDG_ACTIVATION_TOKEN", token.toUtf8());
|
||||
}
|
||||
|
||||
void QStatusNotifierItemAdaptor::Scroll(int w, const QString &s)
|
||||
{
|
||||
qCDebug(qLcTray) << w << s;
|
||||
|
@ -73,6 +73,9 @@ class QStatusNotifierItemAdaptor: public QDBusAbstractAdaptor
|
||||
" <property access=\"read\" type=\"(sa(iiay)ss)\" name=\"ToolTip\">\n"
|
||||
" <annotation value=\"QXdgDBusToolTipStruct\" name=\"org.qtproject.QtDBus.QtTypeName\"/>\n"
|
||||
" </property>\n"
|
||||
" <method name=\"ProvideXdgActivationToken\">\n"
|
||||
" <arg name=\"token\" type=\"s\" direction=\"in\"/>\n"
|
||||
" </method>\n"
|
||||
" <method name=\"ContextMenu\">\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"x\"/>\n"
|
||||
" <arg direction=\"in\" type=\"i\" name=\"y\"/>\n"
|
||||
@ -150,6 +153,7 @@ public: // PROPERTIES
|
||||
public Q_SLOTS: // METHODS
|
||||
void Activate(int x, int y);
|
||||
void ContextMenu(int x, int y);
|
||||
void ProvideXdgActivationToken(const QString &token);
|
||||
void Scroll(int delta, const QString &orientation);
|
||||
void SecondaryActivate(int x, int y);
|
||||
Q_SIGNALS: // SIGNALS
|
||||
|
Loading…
x
Reference in New Issue
Block a user