Complete notification translation and activity watcher cleanup
This commit is contained in:
1 parent
f2e35da1fe
commit
1da667b09e
3 files changed
+10
-4
No files matched your search
@@ -46,8 +46,7 @@ void UserActivityMonitor::start() {
|
||||
m_elapsed.start();
|
||||
qApp->installEventFilter(this);
|
||||
const QString platform = QGuiApplication::platformName();
|
||||
const bool wayland = platform.startsWith("wayland") ||
|
||||
(platform == "xcb" && qEnvironmentVariable("XDG_SESSION_TYPE") == "wayland");
|
||||
const bool wayland = platform.startsWith("wayland") || qEnvironmentVariable("XDG_SESSION_TYPE") == "wayland";
|
||||
#ifdef UTUN_ACTIVITY_DBUS
|
||||
if (wayland && !m_gnomeUnavailable) {
|
||||
m_useGnome = true;
|
||||
@@ -69,6 +68,7 @@ void UserActivityMonitor::stop() {
|
||||
if (m_watching && qApp) qApp->removeEventFilter(this);
|
||||
#ifdef UTUN_ACTIVITY_KIDLETIME
|
||||
if (m_useKIdleTime) KIdleTime::instance()->stopCatchingResumeEvent();
|
||||
disconnect(m_kIdleConnection);
|
||||
#endif
|
||||
m_watching = false;
|
||||
m_dbusPending = false;
|
||||
@@ -128,7 +128,10 @@ void UserActivityMonitor::poll() {
|
||||
startWaylandFallback();
|
||||
return;
|
||||
}
|
||||
if (elapsedMs == 0) GUI_DEBUG("activity: GNOME system idle monitor ready");
|
||||
if (!m_gnomeReadyLogged) {
|
||||
GUI_DEBUG("activity: GNOME system idle monitor ready");
|
||||
m_gnomeReadyLogged = true;
|
||||
}
|
||||
if (reply.value() <= qulonglong(std::numeric_limits<qint64>::max())) checkIdleTime(qint64(reply.value()), elapsedMs);
|
||||
else GUI_WARN("activity: GNOME idle time out of range: %llu", (unsigned long long)reply.value());
|
||||
});
|
||||
@@ -148,7 +151,7 @@ void UserActivityMonitor::startWaylandFallback() {
|
||||
const int timeout = idle->addIdleTimeout(0);
|
||||
if (timeout) {
|
||||
idle->removeIdleTimeout(timeout);
|
||||
connect(idle, &KIdleTime::resumingFromIdle, this, [this] {
|
||||
m_kIdleConnection = connect(idle, &KIdleTime::resumingFromIdle, this, [this] {
|
||||
if (!m_watching || !m_useKIdleTime) return;
|
||||
GUI_DEBUG("activity: Wayland compositor reported user activity");
|
||||
stop();
|
||||
|
||||
@@ -34,7 +34,9 @@ private:
|
||||
bool m_dbusPending = false;
|
||||
bool m_useGnome = false;
|
||||
bool m_gnomeUnavailable = false;
|
||||
bool m_gnomeReadyLogged = false;
|
||||
bool m_useKIdleTime = false;
|
||||
QMetaObject::Connection m_kIdleConnection;
|
||||
quint64 m_generation = 0;
|
||||
void* m_display = nullptr;
|
||||
bool m_x11Checked = false;
|
||||
|
||||
@@ -2146,5 +2146,6 @@ Directories: %5</translation>
|
||||
<message><source>Mute this member in radio</source><translation>Mute this member in radio</translation></message>
|
||||
<message><source>Listen to this member in radio</source><translation>Listen to this member in radio</translation></message>
|
||||
<message><source>Cannot change radio listening setting</source><translation>Cannot change radio listening setting</translation></message>
|
||||
<message><source>New message from %1</source><translation>New message from %1</translation></message>
|
||||
</context>
|
||||
</TS>
|
||||
Reference in new issue
Block a user