Trace cancellation of pending desktop activity queries

This commit is contained in:
evgeny committed 2026-10-07 16:02:10 +02:00
1 parent 16a9094770
commit 2caa653f02
2 files changed
+9 -1

No files matched your search

+5 -1
View File
@@ -118,7 +118,11 @@ void UserActivityMonitor::poll() {
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher, generation, elapsedMs] {
QDBusPendingReply<qulonglong> reply = *watcher;
watcher->deleteLater();
if (!m_watching || generation != m_generation) return;
if (!m_watching || generation != m_generation) {
GUI_DEBUG("activity: ignored obsolete GNOME reply generation=%llu current=%llu watching=%d",
(unsigned long long)generation, (unsigned long long)m_generation, int(m_watching));
return;
}
m_dbusPending = false;
if (reply.isError()) {
GUI_WARN("activity: GNOME idle monitor unavailable: %s", qPrintable(reply.error().message()));
@@ -39,6 +39,8 @@ public slots:
qulonglong GetIdletime() {
++requests;
const qulonglong idle = clock.elapsed() - lastInput;
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "notification test: GNOME request=%d idle=%llu delay_ms=%d dbus=%d",
requests, (unsigned long long)idle, delayMs, int(calledFromDBus()));
if (delayMs) {
const QDBusMessage reply = message().createReply(QVariant::fromValue(idle));
setDelayedReply(true);
@@ -160,7 +162,9 @@ private slots:
QTest::qWait(20);
idle.lastInput = idle.clock.elapsed();
const int before = idle.requests;
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "notification test: waiting for delayed active query after request=%d", before);
QTRY_VERIFY_WITH_TIMEOUT(idle.requests > before, 1000);
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "notification test: cancelling old watch activity_count=%d", int(spy.size()));
activity.stop();
idle.lastInput = idle.clock.elapsed() - 5000;
activity.start();