Merge lp:~3v1n0/sni-qt/x11-usertime-on-activate into lp:sni-qt

Proposed by Marco Trevisan (Treviño) on 2016-11-16
Status: Merged
Approved by: Lukáš Tinkl on 2016-11-22
Approved revision: 103
Merged at revision: 102
Proposed branch: lp:~3v1n0/sni-qt/x11-usertime-on-activate
Merge into: lp:sni-qt
Diff against target: 35 lines (+11/-1)
1 file modified
src/statusnotifieritem.cpp (+11/-1)
To merge this branch: bzr merge lp:~3v1n0/sni-qt/x11-usertime-on-activate
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) 2016-11-16 Approve on 2016-11-22
Review via email: mp+311030@code.launchpad.net

Commit message

statusnotifieritem: reset app usertime on activation to ensure compiz will raise it

To post a comment you must log in.
Lukáš Tinkl (lukas-kde) wrote :

LGTM, works fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/statusnotifieritem.cpp'
2--- src/statusnotifieritem.cpp 2015-07-04 13:55:52 +0000
3+++ src/statusnotifieritem.cpp 2016-11-16 16:31:01 +0000
4@@ -36,6 +36,10 @@
5 #include <QTranslator>
6 #include <QWheelEvent>
7
8+#if defined(Q_WS_X11)
9+#include <QX11Info>
10+#endif
11+
12 static const char* SNI_CATEGORY_PROPERTY = "_sni_qt_category";
13 static const char* DEFAULT_CATEGORY = "ApplicationStatus";
14
15@@ -174,7 +178,7 @@
16 void StatusNotifierItem::Activate(int, int)
17 {
18 SNI_DEBUG;
19- sendActivated(QSystemTrayIcon::Trigger);
20+ sendActivatedByTrigger();
21 }
22
23 void StatusNotifierItem::ContextMenu(int, int)
24@@ -288,6 +292,12 @@
25
26 void StatusNotifierItem::sendActivatedByTrigger()
27 {
28+#if defined(Q_WS_X11)
29+ // Workarounds LP: #627195
30+ if (QString::fromUtf8(getenv("XDG_CURRENT_DESKTOP")).split(':').contains("Unity")) {
31+ QX11Info::setAppUserTime(0);
32+ }
33+#endif
34 sendActivated(QSystemTrayIcon::Trigger);
35 }
36

Subscribers

People subscribed via source and target branches