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