diff --git a/js/ui/realms/realmWindowFrame.js b/js/ui/realms/realmWindowFrame.js index abd490239..e200102a1 100644 --- a/js/ui/realms/realmWindowFrame.js +++ b/js/ui/realms/realmWindowFrame.js @@ -73,9 +73,9 @@ class RealmFrameEffect extends Clutter.Effect { this._color = color; this._label_on_top = true; this._label = null; + this._label_text = label_text; if (label_text) { - this._label = this._createLabel(actor, label_text); this._updateLabel(actor.metaWindow); } @@ -111,6 +111,21 @@ class RealmFrameEffect extends Clutter.Effect { } _updateLabel(window) { + if (!this._label_text) { + return; + } + + if (window.is_fullscreen()) { + if (this._label) { + let actor = window.get_compositor_private(); + actor.remove_child(this._label); + this._label = null; + } + } else if (!this._label) { + let actor = window.get_compositor_private(); + this._label = this._createLabel(actor, this._label_text); + } + if (this._label) { this._updateLabelPosition(window); this._updateLabelColor();