mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-08 22:48:28 -04:00
idle: fix screensaver inhibit interfering with manually triggered
inhibitor
This commit is contained in:
@@ -663,7 +663,7 @@ PanelWindow {
|
|||||||
|
|
||||||
IdleInhibitor {
|
IdleInhibitor {
|
||||||
window: barWindow
|
window: barWindow
|
||||||
enabled: SessionService.idleInhibited
|
enabled: SessionService.idleInhibited || IdleService.externalInhibitActive
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Singleton {
|
|||||||
// compositor honoring the bar-surface zwp_idle_inhibit inhibitor,
|
// compositor honoring the bar-surface zwp_idle_inhibit inhibitor,
|
||||||
// which goes inactive whenever the bar surface is occluded
|
// which goes inactive whenever the bar surface is occluded
|
||||||
// (fullscreen windows) or hidden (auto-hide).
|
// (fullscreen windows) or hidden (auto-hide).
|
||||||
const base = enabled && !SessionService.idleInhibited;
|
const base = enabled && !SessionService.idleInhibited && !externalInhibitActive;
|
||||||
monitorOffMonitor.enabled = base && monitorTimeout > 0 && !postLockMonitorActive;
|
monitorOffMonitor.enabled = base && monitorTimeout > 0 && !postLockMonitorActive;
|
||||||
postLockMonitorOffMonitor.enabled = enabled && postLockMonitorActive;
|
postLockMonitorOffMonitor.enabled = enabled && postLockMonitorActive;
|
||||||
lockMonitor.enabled = base && lockTimeout > 0;
|
lockMonitor.enabled = base && lockTimeout > 0;
|
||||||
@@ -182,21 +182,11 @@ Singleton {
|
|||||||
if (externalInhibitActive) {
|
if (externalInhibitActive) {
|
||||||
const apps = DMSService.screensaverInhibitors.map(i => i.appName).join(", ");
|
const apps = DMSService.screensaverInhibitors.map(i => i.appName).join(", ");
|
||||||
log.info("External idle inhibit active from:", apps || "unknown");
|
log.info("External idle inhibit active from:", apps || "unknown");
|
||||||
SessionService.idleInhibited = true;
|
|
||||||
SessionService.inhibitReason = "External app: " + (apps || "unknown");
|
|
||||||
} else {
|
} else {
|
||||||
log.info("External idle inhibit released");
|
log.info("External idle inhibit released");
|
||||||
SessionService.idleInhibited = false;
|
|
||||||
SessionService.inhibitReason = "Keep system awake";
|
|
||||||
}
|
}
|
||||||
|
_rearmIdleMonitors();
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: _applyMonitorEnableds()
|
||||||
_applyMonitorEnableds();
|
|
||||||
if (externalInhibitActive) {
|
|
||||||
const apps = DMSService.screensaverInhibitors.map(i => i.appName).join(", ");
|
|
||||||
SessionService.idleInhibited = true;
|
|
||||||
SessionService.inhibitReason = "External app: " + (apps || "unknown");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user