idle inhibitor: only remember toggled state within same session

This commit is contained in:
end-4
2025-09-29 22:47:57 +02:00
parent 6e126dc08d
commit 4a40ce5646
2 changed files with 27 additions and 2 deletions
+14 -2
View File
@@ -12,10 +12,22 @@ Singleton {
id: root
property alias inhibit: idleInhibitor.enabled
inhibit: Persistent.states.idle.inhibit
inhibit: false
Connections {
target: Persistent
function onReadyChanged() {
if (!Persistent.isNewHyprlandInstance) {
root.inhibit = Persistent.states.idle.inhibit
} else {
Persistent.states.idle.inhibit = root.inhibit
}
}
}
function toggleInhibit() {
Persistent.states.idle.inhibit = !Persistent.states.idle.inhibit
root.inhibit = !root.inhibit
Persistent.states.idle.inhibit = root.inhibit
}
IdleInhibitor {