1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -04:00

Fix idle monitor creation

This commit is contained in:
bbedward
2025-09-25 16:30:46 -04:00
parent 778b960130
commit 185ee20f2d

View File

@@ -71,7 +71,6 @@ Singleton {
} }
` `
if (monitorTimeout > 0) {
monitorOffMonitor = Qt.createQmlObject(qmlString, root, "IdleService.MonitorOffMonitor") monitorOffMonitor = Qt.createQmlObject(qmlString, root, "IdleService.MonitorOffMonitor")
monitorOffMonitor.enabled = Qt.binding(() => root._enableGate && root.enabled && root.idleMonitorAvailable && root.monitorTimeout > 0) monitorOffMonitor.enabled = Qt.binding(() => root._enableGate && root.enabled && root.idleMonitorAvailable && root.monitorTimeout > 0)
monitorOffMonitor.respectInhibitors = Qt.binding(() => root.respectInhibitors) monitorOffMonitor.respectInhibitors = Qt.binding(() => root.respectInhibitors)
@@ -83,9 +82,7 @@ Singleton {
root.requestMonitorOn() root.requestMonitorOn()
} }
}) })
}
if (lockTimeout > 0) {
lockMonitor = Qt.createQmlObject(qmlString, root, "IdleService.LockMonitor") lockMonitor = Qt.createQmlObject(qmlString, root, "IdleService.LockMonitor")
lockMonitor.enabled = Qt.binding(() => root._enableGate && root.enabled && root.idleMonitorAvailable && root.lockTimeout > 0) lockMonitor.enabled = Qt.binding(() => root._enableGate && root.enabled && root.idleMonitorAvailable && root.lockTimeout > 0)
lockMonitor.respectInhibitors = Qt.binding(() => root.respectInhibitors) lockMonitor.respectInhibitors = Qt.binding(() => root.respectInhibitors)
@@ -95,9 +92,7 @@ Singleton {
root.lockRequested() root.lockRequested()
} }
}) })
}
if (suspendTimeout > 0) {
suspendMonitor = Qt.createQmlObject(qmlString, root, "IdleService.SuspendMonitor") suspendMonitor = Qt.createQmlObject(qmlString, root, "IdleService.SuspendMonitor")
suspendMonitor.enabled = Qt.binding(() => root._enableGate && root.enabled && root.idleMonitorAvailable && root.suspendTimeout > 0) suspendMonitor.enabled = Qt.binding(() => root._enableGate && root.enabled && root.idleMonitorAvailable && root.suspendTimeout > 0)
suspendMonitor.respectInhibitors = Qt.binding(() => root.respectInhibitors) suspendMonitor.respectInhibitors = Qt.binding(() => root.respectInhibitors)
@@ -107,9 +102,7 @@ Singleton {
root.requestSuspend() root.requestSuspend()
} }
}) })
}
if (hibernateTimeout > 0 && SessionService.hibernateSupported) {
hibernateMonitor = Qt.createQmlObject(qmlString, root, "IdleService.HibernateMonitor") hibernateMonitor = Qt.createQmlObject(qmlString, root, "IdleService.HibernateMonitor")
hibernateMonitor.enabled = Qt.binding(() => root._enableGate && root.enabled && root.idleMonitorAvailable && root.hibernateTimeout > 0) hibernateMonitor.enabled = Qt.binding(() => root._enableGate && root.enabled && root.idleMonitorAvailable && root.hibernateTimeout > 0)
hibernateMonitor.respectInhibitors = Qt.binding(() => root.respectInhibitors) hibernateMonitor.respectInhibitors = Qt.binding(() => root.respectInhibitors)
@@ -119,7 +112,6 @@ Singleton {
root.requestHibernate() root.requestHibernate()
} }
}) })
}
} catch (e) { } catch (e) {
console.warn("IdleService: Error creating IdleMonitors:", e) console.warn("IdleService: Error creating IdleMonitors:", e)
} }