Keep single notification hold

This commit is contained in:
Charles Gagnon
2025-02-26 14:52:43 -05:00
parent 78161622af
commit 692f679647

View File

@@ -60,7 +60,6 @@ export const Intellihide = class {
this._panelManager = dtpPanel.panelManager
this._proximityManager = this._panelManager.proximityManager
this._holdStatus = Hold.NONE
this._holdNotifyCount = 0
this._signalsHandler = new Utils.GlobalSignalsHandler()
this._timeoutsHandler = new Utils.TimeoutsHandler()
@@ -174,26 +173,13 @@ export const Intellihide = class {
this._holdStatus |= holdStatus
if (holdStatus == Hold.NOTIFY) this._holdNotifyCount++
this._maybePersistHoldStatus()
}
release(holdStatus) {
if (!this.enabled) return
if (
this._holdStatus & holdStatus &&
(holdStatus != Hold.NOTIFY || !--this._holdNotifyCount)
)
this._holdStatus -= holdStatus
if (holdStatus == Hold.PERMANENT && this._holdStatus & Hold.NOTIFY) {
// the user pressed the keyboard shortcut to hide the panel while a
// notification hold is present, clear it to hide the panel
this._holdStatus -= Hold.NOTIFY
this._holdNotifyCount = 0
}
if (this._holdStatus & holdStatus) this._holdStatus -= holdStatus
if (!this._holdStatus) {
this._maybePersistHoldStatus()