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
=== modified file 'src/statusnotifieritem.cpp'
--- src/statusnotifieritem.cpp 2015-07-04 13:55:52 +0000
+++ src/statusnotifieritem.cpp 2016-11-16 16:31:01 +0000
@@ -36,6 +36,10 @@
36#include <QTranslator>36#include <QTranslator>
37#include <QWheelEvent>37#include <QWheelEvent>
3838
39#if defined(Q_WS_X11)
40#include <QX11Info>
41#endif
42
39static const char* SNI_CATEGORY_PROPERTY = "_sni_qt_category";43static const char* SNI_CATEGORY_PROPERTY = "_sni_qt_category";
40static const char* DEFAULT_CATEGORY = "ApplicationStatus";44static const char* DEFAULT_CATEGORY = "ApplicationStatus";
4145
@@ -174,7 +178,7 @@
174void StatusNotifierItem::Activate(int, int)178void StatusNotifierItem::Activate(int, int)
175{179{
176 SNI_DEBUG;180 SNI_DEBUG;
177 sendActivated(QSystemTrayIcon::Trigger);181 sendActivatedByTrigger();
178}182}
179183
180void StatusNotifierItem::ContextMenu(int, int)184void StatusNotifierItem::ContextMenu(int, int)
@@ -288,6 +292,12 @@
288292
289void StatusNotifierItem::sendActivatedByTrigger()293void StatusNotifierItem::sendActivatedByTrigger()
290{294{
295#if defined(Q_WS_X11)
296 // Workarounds LP: #627195
297 if (QString::fromUtf8(getenv("XDG_CURRENT_DESKTOP")).split(':').contains("Unity")) {
298 QX11Info::setAppUserTime(0);
299 }
300#endif
291 sendActivated(QSystemTrayIcon::Trigger);301 sendActivated(QSystemTrayIcon::Trigger);
292}302}
293303

Subscribers

People subscribed via source and target branches