From 215282a320ca8f2b44b950191bed193db2fe4f0c Mon Sep 17 00:00:00 2001 From: Stuart Hayhurst Date: Sun, 27 Aug 2023 19:25:42 +0100 Subject: [PATCH] osdWindow: Allow label and level to be null Allow passing 'null' to setLevel and setLabel, so 'null' and 'undefined' behave the same way. Fixes a regression introduced by a42f7c23, which caused parts of old notifications to persist into new notifications, or elements being incorrectly made visible Part-of: --- js/ui/osdWindow.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js index dcefd44c9..9d32e40cb 100644 --- a/js/ui/osdWindow.js +++ b/js/ui/osdWindow.js @@ -65,15 +65,15 @@ class OsdWindow extends Clutter.Actor { } setLabel(label) { - this._label.visible = label !== undefined; - if (label) + this._label.visible = label != null; + if (this._label.visible) this._label.text = label; this._updateBoxVisibility(); } setLevel(value) { - this._level.visible = value !== undefined; - if (value !== undefined) { + this._level.visible = value != null; + if (this._level.visible) { if (this.visible) { this._level.ease_property('value', value, { mode: Clutter.AnimationMode.EASE_OUT_QUAD,